Commit Graph

8 Commits

Author SHA1 Message Date
weli d470e2e95e fix(department-e2e): use waitFor for role selector to avoid race condition
Replace one-shot isVisible() with waitFor() to handle the timing gap
where the SPA route guard is still resolving roles asynchronously.
The role selector renders after the route guard's read() call completes,
and isVisible() may return false if called before that.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 07:57:54 +08:00
weli d95c675f75 fix(department): wait for auto-role redirect before department test
When user has exactly 1 active role, chooseRole auto-selects it and
enqueues a router.push to the landing page. loginAndDismissSelectors
now waits for this SPA redirect to complete, so the route guard's
org/department loading runs before page.goto('/clazz') does a full
reload. Also adds extra retry for department loading as fallback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 22:36:35 +08:00
weli 39f22ca0da fix(department): comprehensive debug logging for CI department test failure
Add JWT payload inspection, networkidle wait, and full localStorage snapshot
to diagnose why loadMyDepartments fails to set CurrentDepartmentId on CI.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 22:34:30 +08:00
weli 08659f28ce chore(department): add debug logging for CI test failure
CurrentDepartmentId is set but JWT lacks current_department_id.
Adding detailed path/token logs at each iteration to diagnose.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 20:56:42 +08:00
weli bfbf1e91df fix(department): handle multi-org user in single-department transparent test
CI test user has 2 orgs, so the router guard redirects to /org/select
before departments can be loaded. Added loginAndDismissSelectors helper
that clicks through org selection then role selection before navigating
to /clazz.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 20:09:21 +08:00
weli 5a1d903ffc fix(department): 兼容 JWT current_department_id 可能位于 top-level 或 sub 两种位置
添加 JWT 结构日志便于调试 CI 失败

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 19:23:01 +08:00
weli 5a1effd521 e2e: enable clazz-ui FullCalendar test, fix department-single-transparent
- Un-skip clazz-ui FullCalendar test by adding login + role selection
- Use subjectPayload.current_department_id (JWT sub claim) for dept
  assertion instead of top-level payload
- Add explicit auth token waits and /clazz navigation for reliability
- Remove unnecessary timeouts and debug logging

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 18:30:05 +08:00
weli dd428613e2 test: add single-department transparent E2E tests 2026-05-02 16:37:45 +08:00