added guardian login with views for their assigned childs

This commit is contained in:
2026-09-20 11:11:58 +02:00
parent e4e2b1a4fb
commit 67c935c05b
117 changed files with 4784 additions and 1514 deletions
+28
View File
@@ -0,0 +1,28 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:marianum_mobile/access/user_role.dart';
import 'package:marianum_mobile/state/app/modules/capabilities/bloc/capabilities_state.dart';
void main() {
test('parses the server wire values', () {
expect(UserRole.parse('STUDENT'), UserRole.student);
expect(UserRole.parse('TEACHER'), UserRole.teacher);
expect(UserRole.parse('STAFF'), UserRole.staff);
expect(UserRole.parse('PARENT'), UserRole.parent);
});
test('missing or unknown values are unknown, never an error', () {
expect(UserRole.parse(null), UserRole.unknown);
expect(UserRole.parse('ALUMNUS'), UserRole.unknown);
});
test('hydrated capability states from older versions stay readable', () {
final state = CapabilitiesState.fromJson({
'viewForeignTimetables': true,
'pushNotifications': true,
'userType': 'TEACHER',
'loaded': true,
});
expect(state.role, UserRole.teacher);
expect(CapabilitiesState.fromJson({}).role, UserRole.unknown);
});
}