Update Saqel Platform: 2026-09-12 16:23:39
This commit is contained in:
@@ -7,9 +7,9 @@ import 'package:student_app/presentation/screens/virtual_labs/labs_registry.dart
|
||||
import 'package:student_app/presentation/screens/virtual_labs/subject_virtual_labs_view.dart';
|
||||
|
||||
void main() {
|
||||
test('registry covers all Grade-10 labs (48 entries, 14 subjects)', () {
|
||||
test('registry covers all Grade-10 labs (48 entries, 13 subjects)', () {
|
||||
expect(Grade10LabsRegistry.all.length, 48);
|
||||
expect(Grade10LabsRegistry.subjects.length, 14);
|
||||
expect(Grade10LabsRegistry.subjects.length, 13);
|
||||
final ids = Grade10LabsRegistry.all.map((e) => e.id).toSet();
|
||||
expect(ids.length, 48); // stable unique ids
|
||||
});
|
||||
@@ -98,6 +98,37 @@ void main() {
|
||||
'arabic_10_semester_1_unit_01_lesson_01');
|
||||
});
|
||||
|
||||
test('findForLesson strictly enforces subject isolation (no physics leak to History/Digital)', () {
|
||||
Grade10LabsRegistry.previewModeEnabled = true;
|
||||
|
||||
// History lesson 2 must NEVER return physics vector lab
|
||||
final historyLab = Grade10LabsRegistry.findForLesson(
|
||||
subjectTitle: 'تاريخ الأردن (Jordan History 10)',
|
||||
lessonTitle: 'الدرس الثاني: الإمبراطورية الساسانية',
|
||||
lessonId: 'lesson_02',
|
||||
);
|
||||
expect(historyLab, isNull);
|
||||
|
||||
// Digital skills lesson 1 must NEVER return physics vectors intro lab
|
||||
final digitalLab = Grade10LabsRegistry.findForLesson(
|
||||
subjectTitle: 'المهارات الرقمية (Digital Skills 10)',
|
||||
lessonTitle: 'معالجة البيانات',
|
||||
lessonId: 'lesson_01',
|
||||
);
|
||||
expect(digitalLab, isNull);
|
||||
|
||||
// History lesson 1 MUST return Persian Empire lab, NOT physics!
|
||||
final historyUnit1Lab = Grade10LabsRegistry.findForLesson(
|
||||
subjectTitle: 'تاريخ الأردن (Jordan History 10)',
|
||||
lessonTitle: 'الدرس الأول: الإمبراطورية الفارسية: النشأة والتطور',
|
||||
lessonId: 'lesson_01',
|
||||
curriculumLessonId: 'history_10_semester_1_unit_01_lesson_01',
|
||||
);
|
||||
expect(historyUnit1Lab, isNotNull);
|
||||
expect(historyUnit1Lab?.identity.curriculumLessonId, 'history_10_semester_1_unit_01_lesson_01');
|
||||
expect(historyUnit1Lab?.subjectAr, 'التاريخ');
|
||||
});
|
||||
|
||||
test('a lab is published only when released AND bundle version provided', () {
|
||||
// Emulate a server bundle arriving only for released bound lesson.
|
||||
const released = LabIdentity(
|
||||
|
||||
Reference in New Issue
Block a user