feat(app): stage tabs are Summary (input and output), Artifacts, Changes and More (session and definition)
This commit is contained in:
@@ -21,8 +21,18 @@ void main() {
|
||||
expect(find.text('Back'), findsNothing);
|
||||
// The page bar's own Back is the only one.
|
||||
expect(find.byKey(const Key('run-visit-back')), findsOneWidget);
|
||||
// Four tabs: Summary, Artifacts, Changes, More.
|
||||
expect(shownVisitSections, [
|
||||
RunVisitSection.summary,
|
||||
RunVisitSection.artifacts,
|
||||
RunVisitSection.changes,
|
||||
RunVisitSection.more,
|
||||
]);
|
||||
// Summary holds both Input and Output.
|
||||
expect(find.text('Input'), findsOneWidget);
|
||||
expect(find.text('Output'), findsOneWidget);
|
||||
// Every tab shows its glyph above its name.
|
||||
for (final section in RunVisitSection.values) {
|
||||
for (final section in shownVisitSections) {
|
||||
final tab = find.byKey(ValueKey('run-visit-tab-${section.name}'));
|
||||
expect(
|
||||
find.descendant(
|
||||
|
||||
@@ -115,10 +115,24 @@ Future<void> openVisit(
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
/// Opens the tab showing [section]: Input and Output are on Summary, Session
|
||||
/// and Definition behind More's switch.
|
||||
Future<void> openVisitTab(WidgetTester tester, RunVisitSection section) async {
|
||||
final tab = find.byKey(ValueKey('run-visit-tab-${section.name}'));
|
||||
final shown = visitTabFor(section);
|
||||
final tab = find.byKey(ValueKey('run-visit-tab-${shown.name}'));
|
||||
await tester.ensureVisible(tab);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(tab);
|
||||
await tester.pumpAndSettle();
|
||||
if (section == RunVisitSection.session ||
|
||||
section == RunVisitSection.definition) {
|
||||
final choice = find.descendant(
|
||||
of: find.byKey(const Key('run-visit-more-switch')),
|
||||
matching: find.text(
|
||||
section == RunVisitSection.session ? 'Session' : 'Definition',
|
||||
),
|
||||
);
|
||||
await tester.tap(choice);
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user