-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove "Lesson start" and "Lesson length" from the timetable settings…
… page, as they can be found in "Lesson times". (#1767) | Before | After | |--------|--------| | ![timetable_settings_page_light iphone11](https://github.com/user-attachments/assets/420425d7-d864-48e3-b341-0d3139b8a0dd) | ![timetable_settings_page_light iphone11](https://github.com/user-attachments/assets/1417e36c-0990-40b4-a01a-97debfe9b5ec) | Should be a cleaner page now. Closes #1297
- Loading branch information
1 parent
91d0708
commit c6b77ad
Showing
13 changed files
with
459 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+40 KB
app/test_goldens/timetable/goldens/timetable_settings_page_dark.iphone11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.2 KB
app/test_goldens/timetable/goldens/timetable_settings_page_dark.phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.5 KB
...test_goldens/timetable/goldens/timetable_settings_page_dark.phone_landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.7 KB
...est_goldens/timetable/goldens/timetable_settings_page_dark.tablet_landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+46 KB
...test_goldens/timetable/goldens/timetable_settings_page_dark.tablet_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36.2 KB
app/test_goldens/timetable/goldens/timetable_settings_page_light.iphone11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.5 KB
app/test_goldens/timetable/goldens/timetable_settings_page_light.phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.6 KB
...est_goldens/timetable/goldens/timetable_settings_page_light.phone_landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43 KB
...st_goldens/timetable/goldens/timetable_settings_page_light.tablet_landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43 KB
...est_goldens/timetable/goldens/timetable_settings_page_light.tablet_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions
85
app/test_goldens/timetable/timetable_settings_page_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// Copyright (c) 2022 Sharezone UG (haftungsbeschränkt) | ||
// Licensed under the EUPL-1.2-or-later. | ||
// | ||
// You may obtain a copy of the Licence at: | ||
// https://joinup.ec.europa.eu/software/page/eupl | ||
// | ||
// SPDX-License-Identifier: EUPL-1.2 | ||
|
||
import 'package:bloc_provider/bloc_provider.dart'; | ||
import 'package:bloc_provider/multi_bloc_provider.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:golden_toolkit/golden_toolkit.dart'; | ||
import 'package:mockito/annotations.dart'; | ||
import 'package:mockito/mockito.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:sharezone/settings/src/bloc/user_settings_bloc.dart'; | ||
import 'package:sharezone/settings/src/subpages/timetable/bloc/timetable_settings_bloc_factory.dart'; | ||
import 'package:sharezone/settings/src/subpages/timetable/time_picker_settings_cache.dart'; | ||
import 'package:sharezone/settings/src/subpages/timetable/timetable_settings_page.dart'; | ||
import 'package:sharezone/sharezone_plus/subscription_service/subscription_service.dart'; | ||
import 'package:sharezone/timetable/src/models/lesson_length/lesson_length_cache.dart'; | ||
import 'package:sharezone_widgets/sharezone_widgets.dart'; | ||
import 'package:user/user.dart'; | ||
|
||
import 'timetable_settings_page_test.mocks.dart'; | ||
|
||
@GenerateNiceMocks([ | ||
MockSpec<LessonLengthCache>(), | ||
MockSpec<TimePickerSettingsCache>(), | ||
MockSpec<SubscriptionService>(), | ||
MockSpec<UserSettingsBloc>(), | ||
]) | ||
void main() { | ||
group(TimetableSettingsPage, () { | ||
late UserSettingsBloc userSettingsBloc; | ||
|
||
setUp(() { | ||
userSettingsBloc = MockUserSettingsBloc(); | ||
|
||
when(userSettingsBloc.streamUserSettings()) | ||
.thenAnswer((_) => Stream.value(UserSettings.defaultSettings())); | ||
}); | ||
|
||
Future<void> pumpTimetableSettingsPage( | ||
WidgetTester tester, { | ||
ThemeData? themeData, | ||
}) async { | ||
await tester.pumpWidgetBuilder( | ||
Provider<SubscriptionService>( | ||
create: (context) => MockSubscriptionService(), | ||
child: MultiBlocProvider( | ||
blocProviders: [ | ||
BlocProvider<TimetableSettingsBlocFactory>( | ||
bloc: TimetableSettingsBlocFactory( | ||
MockLessonLengthCache(), | ||
MockTimePickerSettingsCache(), | ||
), | ||
), | ||
BlocProvider<UserSettingsBloc>(bloc: userSettingsBloc) | ||
], | ||
child: (_) => const TimetableSettingsPage(), | ||
), | ||
), | ||
wrapper: materialAppWrapper(theme: themeData), | ||
); | ||
} | ||
|
||
testGoldens('should render as expected (light mode)', (tester) async { | ||
await pumpTimetableSettingsPage( | ||
tester, | ||
themeData: getLightTheme(), | ||
); | ||
await multiScreenGolden(tester, 'timetable_settings_page_light'); | ||
}); | ||
|
||
testGoldens('should render as expected (dark mode)', (tester) async { | ||
await pumpTimetableSettingsPage( | ||
tester, | ||
themeData: getDarkTheme(), | ||
); | ||
await multiScreenGolden(tester, 'timetable_settings_page_dark'); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.