fix: harden school imports and add optional feedback diagnostics

This commit is contained in:
Codex
2026-10-15 10:37:32 +08:00
parent 674df1ceb3
commit 7299f4d8b6
25 changed files with 722 additions and 42 deletions
@@ -109,4 +109,24 @@ void main() {
'{"schemaVersion":1,"courses":[${const JsonEncoder().convert(old)}]}';
expect(() => JsonScheduleImport.parse(json), throwsFormatException);
});
test('graduate timetable changes preserve independently saved undergraduate exams', () async {
await controller.initialize();
await controller.applyExams(exams());
await controller.applyImport(
ImportDraft(
courses: [course()],
explicitlyEmpty: false,
source: course().source,
parserVersion: 'test',
schoolTerm: SchoolTerm(72),
),
confirmedEmpty: false,
);
expect(controller.lastError, isNull);
expect(
controller.snapshot.examSchedule?.school,
SupportedSchool.uestcUndergraduate,
);
expect(controller.snapshot.examSchedule?.termId, '503');
});
}