chore: establish learning module baseline

This commit is contained in:
inman committed 2026-08-16 14:58:47 +08:00
commit 2d04197f3f
2409 files changed
+533050

No files matched your search

@@ -0,0 +1,14 @@
import { describe, expect, it } from 'vitest';
import { courseModuleCoursewareId } from '@/lib/course-framework/publish-identity';
describe('large-course public module identity', () => {
it('is stable and does not contain the mutable classroom id', () => {
expect(courseModuleCoursewareId('course-123', 2)).toBe('course_course-123_module_2');
expect(courseModuleCoursewareId('course-123', 2)).not.toContain('classroom-private-source');
});
it('rejects invalid course and module identities', () => {
expect(() => courseModuleCoursewareId('../course', 1)).toThrow('Invalid course id');
expect(() => courseModuleCoursewareId('course-123', 0)).toThrow('Invalid module index');
});
});