Ad and purchases enabled (still need actual testing)

This commit is contained in:
Courtney Arnold 2026-08-16 18:27:56 -05:00
parent 2fcc6dcab7
commit faf319322a
35 changed files with 1676 additions and 34 deletions

View file

@ -241,6 +241,8 @@ void main() {
expect(find.byType(DataSettingsScreen), findsNothing, reason: 'tour-pushed screen popped');
expect(find.text('Back Up to the Cloud'), findsNothing, reason: 'overlay gone');
expect(appState.hasSeenOnboardingTour, isTrue);
expect(find.widgetWithText(AppBar, 'Receipts'), findsOneWidget,
reason: 'returned to Receipts, not left on the Settings tab the tour ended on');
final prefs = await SharedPreferences.getInstance();
expect(prefs.getBool('has_seen_onboarding_tour'), isTrue,
@ -256,14 +258,30 @@ void main() {
expect(find.text('What This App Does'), findsNothing);
expect(appState.hasSeenOnboardingTour, isTrue);
expect(find.widgetWithText(AppBar, 'Receipts'), findsOneWidget,
reason: 'stayed on the tab it started on');
expect(find.widgetWithText(AppBar, 'Receipts'), findsOneWidget);
});
testWidgets('Skip Tour from the last step still pops the tour-pushed Data screen',
testWidgets('Skip Tour from a later step still returns to Receipts, not the tab it was on',
(tester) async {
await pumpShellWithFreshTour(tester);
// Two steps in, the tour has already jumped to the Vehicles tab.
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
await tester.pumpAndSettle();
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
await tester.pumpAndSettle();
expect(find.widgetWithText(AppBar, 'Vehicles'), findsOneWidget);
await tester.tap(find.widgetWithText(TextButton, 'Skip Tour'));
await tester.pumpAndSettle();
expect(find.widgetWithText(AppBar, 'Receipts'), findsOneWidget);
});
testWidgets('Skip Tour from the last step pops the tour-pushed Data screen and returns to '
'Receipts', (tester) async {
await pumpShellWithFreshTour(tester);
for (var i = 0; i < 5; i++) {
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
await tester.pumpAndSettle();
@ -274,6 +292,7 @@ void main() {
await tester.pumpAndSettle();
expect(find.byType(DataSettingsScreen), findsNothing);
expect(find.widgetWithText(AppBar, 'Receipts'), findsOneWidget);
});
});
}