Fix release notification resource and add multiple advance reminders

This commit is contained in:
Codex
2026-10-14 11:30:37 +08:00
parent caf7abe0c0
commit 4d86db3dd5
16 changed files with 350 additions and 58 deletions
@@ -41,7 +41,7 @@ void main() {
events: events,
monday: term.firstMonday,
today: term.startDate,
settings: const AppSettings(),
settings: AppSettings(),
),
),
),
@@ -108,7 +108,7 @@ void main() {
events: events,
monday: term.firstMonday,
today: term.startDate,
settings: const AppSettings(),
settings: AppSettings(),
),
),
),
+37
View File
@@ -19,6 +19,43 @@ import 'package:hepan_everyday/domain/semester.dart';
void main() {
setUpAll(tzdata.initializeTimeZones);
testWidgets(
'reminder times can be selected together and last choice stays selected',
(tester) async {
final controller = uiController();
await controller.initialize();
await tester.pumpWidget(
MaterialApp(home: SettingsPage(controller: controller)),
);
await tester.pumpAndSettle();
await tester.scrollUntilVisible(
find.text('5 分钟'),
250,
scrollable: find.byType(Scrollable).first,
);
await tester.ensureVisible(find.text('5 分钟'));
await tester.pumpAndSettle();
await tester.tap(find.text('5 分钟'));
await tester.pumpAndSettle();
expect(
(controller.snapshot.toJson()['settings'] as Map)['reminderOffsets'],
[5, 15],
);
await tester.tap(find.text('15 分钟'));
await tester.pumpAndSettle();
expect(
(controller.snapshot.toJson()['settings'] as Map)['reminderOffsets'],
[5],
);
await tester.tap(find.text('5 分钟'));
await tester.pumpAndSettle();
expect(
(controller.snapshot.toJson()['settings'] as Map)['reminderOffsets'],
[5],
);
controller.dispose();
},
);
testWidgets(
'partial initial calendar sync exposes working cleanup action while switch is off',
(tester) async {
+1 -1
View File
@@ -35,7 +35,7 @@ void main() {
events: events,
monday: term.firstMonday,
today: term.startDate,
settings: const AppSettings(),
settings: AppSettings(),
),
),
),