From 678d09d97e5a80b913810c06b0ca7a2e0102a0db Mon Sep 17 00:00:00 2001 From: Jonas Sander <29028262+Jonas-Sander@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:37:14 +0100 Subject: [PATCH] Add spaces to tests --- app/test/timetable/timetable_dialog_test.dart | 5 +++++ .../timetable/timetable_dialog/timetable_dialog_test.dart | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/test/timetable/timetable_dialog_test.dart b/app/test/timetable/timetable_dialog_test.dart index 146d40d08..e8e08ee74 100644 --- a/app/test/timetable/timetable_dialog_test.dart +++ b/app/test/timetable/timetable_dialog_test.dart @@ -166,6 +166,7 @@ void main() { expect(find.text(EventDialogErrorStrings.emptyTitle), findsNothing); }); + testWidgets( 'shows title error message if save is pressed and the title is empty', (tester) async { @@ -176,6 +177,7 @@ void main() { expect(find.text(EventDialogErrorStrings.emptyTitle), findsOneWidget); }); + testWidgets( 'removes title error message if save is pressed with an empty title but text is entered afterwards', (tester) async { @@ -188,6 +190,7 @@ void main() { expect(find.text(EventDialogErrorStrings.emptyTitle), findsNothing); }); + testWidgets( 'shows course error message if save is pressed and no course is chosen', (tester) async { @@ -198,6 +201,7 @@ void main() { expect(find.text(EventDialogErrorStrings.emptyCourse), findsOneWidget); }); + testWidgets('removes course error message if a course is chosen', (tester) async { final dt = createDialogTester(tester); @@ -225,6 +229,7 @@ void main() { expect(find.text(EventDialogErrorStrings.endTimeMustBeAfterStartTime), findsOneWidget); }); + testWidgets('doesnt shows error message if end time after start time', (tester) async { final dt = createDialogTester(tester); diff --git a/app/test_goldens/timetable/timetable_dialog/timetable_dialog_test.dart b/app/test_goldens/timetable/timetable_dialog/timetable_dialog_test.dart index 4ea7b0e77..206f815cc 100644 --- a/app/test_goldens/timetable/timetable_dialog/timetable_dialog_test.dart +++ b/app/test_goldens/timetable/timetable_dialog/timetable_dialog_test.dart @@ -67,6 +67,7 @@ void main() { 'event_dialog_add_empty_${testConfig.theme.name}_${testConfig.isExam ? 'exam' : 'event'}', ); }); + testGoldens( 'renders full event dialog as expected (${testConfig.theme.name}, isExam: ${testConfig.isExam})', (tester) async { @@ -96,6 +97,7 @@ void main() { 'event_dialog_add_full_${testConfig.theme.name}_${testConfig.isExam ? 'exam' : 'event'}', ); }); + testGoldens( 'renders error event dialog as expected (${testConfig.theme.name}, isExam: ${testConfig.isExam})', (tester) async {