Use new ?unionid=X&status=2 login support on teacher.moicen.com
instead of the complex cookie-injection workaround (login on music-room
→ extract JWT → inject into teacher domain via document.cookie).
Also seed course packages to both orgs (慧正书法 + 慧添翼) so the
test works regardless of which org the role chooser selects first.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
addCookies uses CDP Storage.setCookies which rejects some JWT cookies with
"Invalid cookie fields" on certain Chromium versions. Switching to
document.cookie bypasses CDP validation entirely.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Read CurrentUserRole from cookies not localStorage. Add cookies with
.moicen.com domain. Navigate directly to /course-packages after
injection so router guard picks up the auth cookie.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
teacher.moicen.com Nginx has no AuthCore middleware, so ?unionid= login
doesn't work there. Login on music-room first, extract JWT, then inject
HtyTeacherToken/CurrentUserRole cookies + localStorage on teacher domain
before navigating to /course-packages.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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>
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>
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>
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>