Commit Graph

4 Commits

Author SHA1 Message Date
weli 27ba562f39 test(course-package): add teacher UI test verifying nav link and page render
Navigate to teacher.moicen.com, verify "课包" nav link is visible for
teacher/supervisor, click through to /course-packages, assert seeded
data renders. Catches frontend build/deploy regressions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 10:36:20 +08:00
weli 75291986cf test(course-package): verify against seeded data from moicen DB
Add pre-seeded course packages for 阿难 on moicen DB: 钢琴一对一课程,
声乐基础训练, 乐理知识速成 (INACTIVE). Update pagination tests to assert
specific names, ACTIVE filtering, sort order, and INACTIVE exclusion.
Extract shared loginAndGetJwt helper to reduce duplication.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 08:58:15 +08:00
weli 894ca05566 fix(course-package): extract role_key from JWT sub roles objects
JWT sub.roles is an array of objects with role_key field, not plain
strings. Fix extractRoleKeys to map role_key from each role object.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 08:41:54 +08:00
weli 1ddeb21ca7 test(course-package): add API CRUD, pagination, and role permission tests
Verify course_package endpoints are only accessible to TEACHER/SUPERVISOR
roles. Test full CRUD cycle and paginated listing APIs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 08:31:04 +08:00