added teacher-focused lesson sheet with direct class and teacher timetable links
This commit is contained in:
@@ -92,4 +92,47 @@ void main() {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
group('applyTeacherDefaults', () {
|
||||
test('hides the absence report once for teachers', () {
|
||||
final settings = settingsWith(Modules.values);
|
||||
|
||||
expect(AppModule.applyTeacherDefaults(settings, isTeacher: true), isTrue);
|
||||
expect(settings.hiddenModules, [Modules.absenceReport]);
|
||||
expect(settings.teacherDefaultsApplied, isTrue);
|
||||
});
|
||||
|
||||
test('keeps a module the teacher re-enabled afterwards', () {
|
||||
final settings = settingsWith(Modules.values);
|
||||
AppModule.applyTeacherDefaults(settings, isTeacher: true);
|
||||
settings.hiddenModules.remove(Modules.absenceReport);
|
||||
|
||||
expect(
|
||||
AppModule.applyTeacherDefaults(settings, isTeacher: true),
|
||||
isFalse,
|
||||
);
|
||||
expect(settings.hiddenModules, isEmpty);
|
||||
});
|
||||
|
||||
test('leaves non-teachers untouched', () {
|
||||
final settings = settingsWith(Modules.values);
|
||||
|
||||
expect(
|
||||
AppModule.applyTeacherDefaults(settings, isTeacher: false),
|
||||
isFalse,
|
||||
);
|
||||
expect(settings.hiddenModules, isEmpty);
|
||||
expect(settings.teacherDefaultsApplied, isFalse);
|
||||
});
|
||||
|
||||
test('does not duplicate an already hidden module', () {
|
||||
final settings = ModulesSettings(
|
||||
moduleOrder: Modules.values,
|
||||
hiddenModules: [Modules.absenceReport, Modules.files],
|
||||
);
|
||||
AppModule.applyTeacherDefaults(settings, isTeacher: true);
|
||||
|
||||
expect(settings.hiddenModules, [Modules.absenceReport, Modules.files]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test('falls back to the teacher when the entry has no class', () {
|
||||
test('shows only the room when the entry has no class', () {
|
||||
expect(
|
||||
_location(showClassInsteadOfTeacher: true, classNames: const []),
|
||||
'A101\nMüller',
|
||||
'A101',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user