diff --git a/app/test/features/pipelines/pipelines_screen_test.dart b/app/test/features/pipelines/pipelines_screen_test.dart index 91c1f61a..f1086d3f 100644 --- a/app/test/features/pipelines/pipelines_screen_test.dart +++ b/app/test/features/pipelines/pipelines_screen_test.dart @@ -127,6 +127,34 @@ void main() { expect(opened, [1]); }); + testWidgets('on a phone the pushed detail never covers another tab', ( + tester, + ) async { + // Runs switches tabs while the Pipelines screen stays mounted; its pushed + // detail used to stay on top, so tapping Runs seemed to do nothing. + tester.view.physicalSize = const Size(390, 844); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + final gateway = gatewayFor(PipelineFixture()); + Widget host({required bool active}) => MaterialApp( + home: PipelinesScreen( + gateway: gateway, + active: active, + onViewPipelineRuns: (_) {}, + ), + ); + await tester.pumpWidget(host(active: true)); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('pipeline-row-1'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('pipeline-view-runs')), findsOneWidget); + + await tester.pumpWidget(host(active: false)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('pipeline-view-runs')), findsNothing); + }); + testWidgets('refresh keeps the selected row and its detail', (tester) async { final fixture = PipelineFixture(); final gateway = gatewayFor(fixture);