feat: integrate undergraduate school workflows and period twelve
This commit is contained in:
@@ -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', () {
|
||||
|
||||
Reference in New Issue
Block a user