Merge commit '06d3e23b796c81aeeef21b27d9cfeb0697845247' into pipelines/run-20261112-0129-desktop-navigation-rail-with-settings-9292
This commit is contained in:
@@ -390,19 +390,24 @@ void main() {
|
||||
await app.stop(tester);
|
||||
});
|
||||
|
||||
testWidgets('X closes the window and returns nothing to the tiling', (
|
||||
tester,
|
||||
) async {
|
||||
testWidgets('X minimises the window: the chat stays open, returns nothing '
|
||||
'to the tiling, and the chord brings the window back', (tester) async {
|
||||
await _saved('a', 'b');
|
||||
final app = _App(_Store());
|
||||
await app.start(tester);
|
||||
await _menu(tester, 'b', 'Float (Alt+Y)');
|
||||
await tester.tap(find.byTooltip('Close'));
|
||||
await tester.tap(find.byTooltip('Minimise'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(app.floating, isEmpty);
|
||||
// Still a window, hidden; not closed and not docked.
|
||||
expect(app.floating, ['b']);
|
||||
expect(app.windows.windows.single.minimized, isTrue);
|
||||
expect(_shown('Chat b'), findsNothing);
|
||||
expect(_workspace(tester).panes.map((p) => p.sessionId), ['a']);
|
||||
expect(_thread('b'), findsNothing);
|
||||
expect(app.gateway.calls.where((c) => c.type == 'chat_close'), isEmpty);
|
||||
await _chord(tester);
|
||||
expect(_shown('Chat b'), findsOneWidget);
|
||||
expect(_thread('b').hitTestable(), findsOneWidget);
|
||||
expect(app.floating, ['b']);
|
||||
await app.stop(tester);
|
||||
});
|
||||
|
||||
|
||||
@@ -244,10 +244,9 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('No input recorded.'), findsOneWidget);
|
||||
|
||||
// Output starts open, so its empty sentence shows without a tap.
|
||||
await tester.ensureVisible(find.text('Output'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Output'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('No output recorded.'), findsOneWidget);
|
||||
});
|
||||
|
||||
@@ -266,5 +265,35 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('ship it'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('${platform.name} summary output starts expanded and '
|
||||
'collapses for this view', (tester) async {
|
||||
await pumpRunDetail(
|
||||
tester,
|
||||
platform,
|
||||
run: recordedRunFixture(),
|
||||
size: const Size(900, 1600),
|
||||
);
|
||||
|
||||
final output = find.byKey(const ValueKey('run-detail-summary-output'));
|
||||
final outputTitle = find.descendant(
|
||||
of: output,
|
||||
matching: find.text('Output'),
|
||||
);
|
||||
final outputBody = find.descendant(of: output, matching: find.text('ok'));
|
||||
// Output opens with its recorded value; Input stays closed.
|
||||
expect(outputBody, findsOneWidget);
|
||||
expect(find.text('ship it'), findsNothing);
|
||||
|
||||
await tester.ensureVisible(outputTitle.first);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(outputTitle.first);
|
||||
await tester.pumpAndSettle();
|
||||
expect(outputBody, findsNothing);
|
||||
|
||||
await tester.tap(outputTitle.first);
|
||||
await tester.pumpAndSettle();
|
||||
expect(outputBody, findsOneWidget);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,21 +49,77 @@ void main() {
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets('${platform.name} visit Output starts expanded and collapses', (
|
||||
tester,
|
||||
) async {
|
||||
await openVisit(tester, platform);
|
||||
final output = find.byKey(const ValueKey('run-visit-section-Output'));
|
||||
final outputTitle = find.descendant(
|
||||
of: output,
|
||||
matching: find.text('Output'),
|
||||
);
|
||||
final outputBody = find.descendant(of: output, matching: find.text('ok'));
|
||||
final input = find.byKey(const ValueKey('run-visit-section-Input'));
|
||||
|
||||
// Output opens expanded; Input stays closed.
|
||||
expect(find.text('result'), findsOneWidget);
|
||||
expect(outputBody, findsOneWidget);
|
||||
expect(find.text('Ship it.'), findsNothing);
|
||||
|
||||
// The operator can collapse Output, and open it again.
|
||||
await tester.ensureVisible(outputTitle.first);
|
||||
await tester.tap(outputTitle.first);
|
||||
await tester.pumpAndSettle();
|
||||
expect(outputBody, findsNothing);
|
||||
expect(find.text('result'), findsNothing);
|
||||
await tester.tap(outputTitle.first);
|
||||
await tester.pumpAndSettle();
|
||||
expect(outputBody, findsOneWidget);
|
||||
expect(input, findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('${platform.name} long visit Output opens lazily and still '
|
||||
'scrolls to its last field', (tester) async {
|
||||
final run = visitRunFixture();
|
||||
firstVisitStep(run)['output'] = <String, dynamic>{
|
||||
for (var i = 0; i < 500; i++) 'field$i': 'value $i',
|
||||
};
|
||||
await openVisit(tester, platform, run: run);
|
||||
|
||||
// Open by default, yet only the fields on screen are built.
|
||||
expect(find.text('value 0'), findsOneWidget);
|
||||
expect(find.text('value 499'), findsNothing);
|
||||
|
||||
// Scrolling the page reaches the rest of the Output.
|
||||
await tester.scrollUntilVisible(
|
||||
find.text('value 499'),
|
||||
500,
|
||||
// The page's own scroll view is the outermost of its scrollables.
|
||||
scrollable: find
|
||||
.descendant(
|
||||
of: find.byKey(const Key('run-visit-body-summary')),
|
||||
matching: find.byType(Scrollable),
|
||||
)
|
||||
.first,
|
||||
);
|
||||
expect(find.text('value 499'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('${platform.name} tabs show recorded values and exact empty '
|
||||
'wording', (tester) async {
|
||||
await openVisit(tester, platform);
|
||||
|
||||
// Each field by name with its value, never raw JSON.
|
||||
// Each field by name with its value, never raw JSON. Output is open at
|
||||
// once; Input's value shows only after its tap.
|
||||
expect(find.text('Ship it.'), findsNothing);
|
||||
expect(find.text('ok'), findsNothing);
|
||||
expect(find.text('ok'), findsOneWidget);
|
||||
await tester.tap(find.text('Input'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('prompt'), findsOneWidget);
|
||||
expect(find.text('Ship it.'), findsOneWidget);
|
||||
expect(find.textContaining('"prompt"'), findsNothing);
|
||||
// Output is open as the visit opens; no tap is needed to read it.
|
||||
await openVisitTab(tester, RunVisitSection.output);
|
||||
await tester.tap(find.text('Output'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('result'), findsOneWidget);
|
||||
expect(find.text('ok'), findsOneWidget);
|
||||
|
||||
@@ -127,13 +183,12 @@ void main() {
|
||||
await openVisit(tester, platform, run: run);
|
||||
|
||||
expect(find.text(visitEmptyInput), findsNothing);
|
||||
expect(find.text(visitEmptyOutput), findsNothing);
|
||||
// Output is open, so its empty sentence is already there.
|
||||
expect(find.text(visitEmptyOutput), findsOneWidget);
|
||||
await tester.tap(find.text('Input'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text(visitEmptyInput), findsOneWidget);
|
||||
await openVisitTab(tester, RunVisitSection.output);
|
||||
await tester.tap(find.text('Output'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text(visitEmptyOutput), findsOneWidget);
|
||||
await openVisitTab(tester, RunVisitSection.artifacts);
|
||||
expect(
|
||||
|
||||
@@ -172,7 +172,17 @@ void main() {
|
||||
expect(find.text('alpha=1, items=1, 2'), findsOneWidget);
|
||||
expect(find.textContaining('"alpha"'), findsNothing);
|
||||
|
||||
await openSummarySection('Output');
|
||||
// Output starts open: its value is there to scroll to, without a tap.
|
||||
await tester.scrollUntilVisible(
|
||||
find.text('ok=true'),
|
||||
200,
|
||||
scrollable: find
|
||||
.descendant(
|
||||
of: find.byKey(const Key('run-detail-tab-body-summary')),
|
||||
matching: find.byType(Scrollable),
|
||||
)
|
||||
.first,
|
||||
);
|
||||
expect(find.text('ok=true'), findsOneWidget);
|
||||
|
||||
await tapTab('Timeline');
|
||||
|
||||
@@ -263,7 +263,7 @@ void main() {
|
||||
});
|
||||
|
||||
for (final platform in RunDetailTestPlatform.values) {
|
||||
testWidgets('${platform.name} input field expands only the input section', (
|
||||
testWidgets('${platform.name} input field expands the input section', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpSelection(
|
||||
@@ -277,7 +277,8 @@ void main() {
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('ship it'), findsOneWidget);
|
||||
expect(find.text('ok'), findsNothing);
|
||||
// Output keeps its default: open, as every Summary opens.
|
||||
expect(find.text('ok'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
@@ -310,8 +311,9 @@ void main() {
|
||||
find.byKey(const Key('run-detail-tab-body-summary')),
|
||||
findsOneWidget,
|
||||
);
|
||||
// The plain Summary shows its default sections: Output open, Input closed.
|
||||
expect(find.text('ship it'), findsNothing);
|
||||
expect(find.text('ok'), findsNothing);
|
||||
expect(find.text('ok'), findsOneWidget);
|
||||
});
|
||||
|
||||
for (final platform in RunDetailTestPlatform.values) {
|
||||
@@ -337,8 +339,9 @@ void main() {
|
||||
find.byKey(const Key('run-detail-tab-body-summary')),
|
||||
findsOneWidget,
|
||||
);
|
||||
// The Summary's default sections: Output open, Input closed.
|
||||
expect(find.text('ship it'), findsNothing);
|
||||
expect(find.text('ok'), findsNothing);
|
||||
expect(find.text('ok'), findsOneWidget);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,19 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
test('Runs and Pipelines switch is Ctrl+A on every platform', () {
|
||||
for (final platform in TargetPlatform.values) {
|
||||
final entry = KeyboardShortcutRegistry(platform: platform, web: false)
|
||||
.entries
|
||||
.firstWhere(
|
||||
(entry) => entry.action == 'Switch between Runs and Pipelines',
|
||||
);
|
||||
expect(entry.keys, 'Ctrl+A', reason: platform.name);
|
||||
expect(entry.caveat, contains('Pipelines'));
|
||||
expect(entry.caveat, contains('text field'));
|
||||
}
|
||||
});
|
||||
|
||||
test('uses the shell primary modifier rule on iOS', () {
|
||||
final entries = const KeyboardShortcutRegistry(
|
||||
platform: TargetPlatform.iOS,
|
||||
|
||||
@@ -167,10 +167,12 @@ void main() {
|
||||
expect(floatFinder, findsOneWidget);
|
||||
expect(frame().size, start.size + const Offset(80, 50));
|
||||
|
||||
await tester.tap(find.byTooltip('Close'));
|
||||
// The X minimises too: the window stays listed, hidden, with its shells.
|
||||
await tester.tap(find.byTooltip('Minimise'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(layout.visible, isFalse);
|
||||
expect(manager.windows, isEmpty);
|
||||
expect(manager.windows.single.minimized, isTrue);
|
||||
expect(floatFinder, findsNothing);
|
||||
expect(hub.tabs, hasLength(2));
|
||||
await ctrlBacktick(tester);
|
||||
expect(floatFinder, findsOneWidget);
|
||||
|
||||
Reference in New Issue
Block a user