feat: integrate undergraduate school workflows and period twelve

This commit is contained in:
Codex
2026-10-15 00:28:04 +08:00
parent 7939bd4c3c
commit b28f333720
15 changed files with 573 additions and 26 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ void main() {
});
test('invalid lesson, weekday and week values are rejected', () {
expect(() => course(first: 0), throwsArgumentError);
expect(() => course(last: 12), throwsArgumentError);
expect(() => course(last: 13), throwsArgumentError);
expect(() => course(day: 8), throwsArgumentError);
expect(() => course(weeks: {0}), throwsArgumentError);
expect(
@@ -7,6 +7,37 @@ import 'package:hepan_everyday/domain/app_snapshot.dart';
import 'package:hepan_everyday/domain/course.dart';
void main() {
test(
'managed undergraduate identifiers cannot lose their school or term',
() {
final c = Course(
id: 'uestc-undergraduate-523-managed',
name: '课程',
teacher: '教师',
room: '教室',
weekday: 1,
startPeriod: 1,
endPeriod: 2,
weeks: {1},
source: CourseSource.school,
);
final saved = AppSnapshot(
courses: [c],
schoolTerm: SchoolTerm(523, school: SupportedSchool.uestcUndergraduate),
).toJson();
expect(
() => AppSnapshot.fromJson({
...saved,
'schoolTerm': {'id': 73},
}),
throwsFormatException,
);
expect(
() => AppSnapshot.fromJson({...saved, 'schoolTerm': null}),
throwsFormatException,
);
},
);
SchoolTerm under(int id) =>
SchoolTerm(id, school: SupportedSchool.uestcUndergraduate);
test('undergraduate semester labels and final exam URLs', () {