Fix cached reminder recovery and retain pre-reconcile idle diagnostics

This commit is contained in:
david1465833828
2026-10-28 17:46:33 +08:00
parent 93bcfd534c
commit dc71e411e9
13 changed files with 350 additions and 6 deletions
+16 -1
View File
@@ -37,6 +37,14 @@ class _Notifications extends FakeNotifications {
'model': 'TestModel',
'sdk': 35,
'backgroundRestricted': true,
'standbyBucket': 45,
'startupAlarmAudit': {
'capturedAtEpochMillis': 123,
'cachedCourseCount': 3,
'existingHandleCount': 1,
'missingHandleCount': 2,
'courseName': 'Private course name',
},
'account': 'private@example.com',
},
'courseNames': ['Private course name'],
@@ -129,7 +137,7 @@ void main() {
final previous = notifications.reconciliations;
await tester.tap(find.text('检查提醒'));
await tester.pump();
expect(notifications.reconciliationsAtDiagnosis, previous + 1);
expect(notifications.reconciliationsAtDiagnosis, previous);
for (final button in tester.widgetList<TextButton>(
find.byType(TextButton),
)) {
@@ -174,5 +182,12 @@ void main() {
expect(report['courseCount'], 0);
expect(report['appVersion'], isNotEmpty);
expect((report['system'] as Map)['model'], 'TestModel');
expect(
((report['system'] as Map)['startupAlarmAudit']
as Map)['missingHandleCount'],
2,
);
expect((report['beforeCheck'] as Map)['pendingCount'], 2);
expect(find.textContaining('系统待机限制'), findsOneWidget);
});
}