import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:pipelines_app/features/settings/settings_keys.dart'; import 'package:pipelines_app/features/settings/settings_walkthrough_section.dart'; import 'package:pipelines_app/ui/theme/app_theme.dart'; void main() { testWidgets('Settings reopens the walkthrough on the first page', ( tester, ) async { tester.view.devicePixelRatio = 1; tester.view.physicalSize = const Size(390, 844); addTearDown(tester.view.resetPhysicalSize); addTearDown(tester.view.resetDevicePixelRatio); await tester.pumpWidget( MaterialApp( theme: appLightTheme(), home: const Scaffold(body: SettingsWalkthroughSection()), ), ); expect(find.text('Show the walkthrough'), findsOneWidget); expect(find.text('Welcome to Pipelines'), findsNothing); await tester.tap(find.byKey(SettingsKeys.walkthrough)); await tester.pumpAndSettle(); expect(find.text('Welcome to Pipelines'), findsOneWidget); expect(find.text('Step 1 of 4'), findsOneWidget); await tester.tap(find.byKey(const ValueKey('walkthrough.skip'))); await tester.pumpAndSettle(); expect(find.text('Welcome to Pipelines'), findsNothing); }); }