From aaf9abf40ed7308bf91dcc91731efcfaccbe85e8 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 10 Aug 2026 13:08:02 +0200 Subject: [PATCH] Make the offline create guard in the routine form falsifiable --- .../features/routines/widgets/forms/routine_form_test.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/features/routines/widgets/forms/routine_form_test.dart b/test/features/routines/widgets/forms/routine_form_test.dart index e728cf0f5..a98f038d3 100644 --- a/test/features/routines/widgets/forms/routine_form_test.dart +++ b/test/features/routines/widgets/forms/routine_form_test.dart @@ -292,9 +292,12 @@ void main() { ); expect(button.enabled, isFalse); - // And tapping it must not trigger the create request. + // Fill the form first: an invalid form is rejected by the validator, which + // would make the verifyNever below pass no matter what the gate does. + await tester.enterText(find.byKey(const Key('field-name')), 'New cool routine'); await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME)), warnIfMissed: false); - await tester.pump(); + await tester.pumpAndSettle(); + verifyNever(mockRoutinesRepository.addRoutineServer(any)); }); }