61 lines
2.7 KiB
Markdown
61 lines
2.7 KiB
Markdown
---
|
|
# nuzlocke-tracker-kix5
|
|
title: Fix e2e tests after boss feature changes
|
|
status: draft
|
|
type: bug
|
|
priority: normal
|
|
created_at: 2026-03-20T19:19:31Z
|
|
updated_at: 2026-03-20T19:19:36Z
|
|
blocked_by:
|
|
- nuzlocke-tracker-neqv
|
|
---
|
|
|
|
The e2e tests (accessibility + mobile) are failing because the test infrastructure hasn't been updated since the boss feature, journal, and admin pages were added.
|
|
|
|
## Problems
|
|
|
|
### 1. Missing pages in test coverage
|
|
Both `accessibility.spec.ts` and `mobile.spec.ts` share a hardcoded page list that is missing several routes added since the tests were written:
|
|
|
|
**Missing from page list:**
|
|
- `runs/:runId/journal/:entryId` — Journal entry page (requires journal fixture)
|
|
- `admin/games/:gameId` — Admin game detail page (requires game fixture ID)
|
|
- `admin/games/:gameId/routes/:routeId` — Admin route detail page (requires route fixture ID)
|
|
- `admin/runs` — Admin runs page
|
|
- `admin/genlockes` — Admin genlockes page
|
|
- `admin/genlockes/:genlockeId` — Admin genlocke detail page (requires genlocke fixture ID)
|
|
|
|
### 2. Missing test fixtures/seeding
|
|
The global-setup seeds runs, encounters, and genlockes but does **not** seed:
|
|
- Boss battles (via `/games/{game_id}/bosses`)
|
|
- Boss results (via `/runs/{run_id}/boss-results`)
|
|
- Journal entries (via journal API)
|
|
- Version groups (required for boss battles to work)
|
|
|
|
The RunEncounters page now renders a boss battle section, which likely makes API calls that fail or produce unexpected DOM, causing accessibility or layout violations.
|
|
|
|
### 3. Shared page list duplication
|
|
Both spec files duplicate the same page list — should be extracted to a shared constant in `fixtures.ts`.
|
|
|
|
## Checklist
|
|
|
|
- [ ] Update `fixtures.ts` to export a shared page list with all current routes
|
|
- [ ] Add boss battle seeding to `global-setup.ts` (create boss via API after game seed)
|
|
- [ ] Add boss result seeding to `global-setup.ts` (create result for the test run)
|
|
- [ ] Add journal entry seeding to `global-setup.ts` (create entry for the test run)
|
|
- [ ] Add new fixture IDs to `Fixtures` interface (journalEntryId, routeId, bossId, etc.)
|
|
- [ ] Update `accessibility.spec.ts` to use shared page list
|
|
- [ ] Update `mobile.spec.ts` to use shared page list
|
|
- [ ] Run e2e tests locally and verify they pass
|
|
- [ ] Fix any new accessibility or layout violations on boss/journal pages
|
|
|
|
## Files to modify
|
|
- `frontend/e2e/fixtures.ts`
|
|
- `frontend/e2e/global-setup.ts`
|
|
- `frontend/e2e/accessibility.spec.ts`
|
|
- `frontend/e2e/mobile.spec.ts`
|
|
|
|
## Notes
|
|
- The boss feature is still in progress (epic `nuzlocke-tracker-neqv`). This bean should be worked on after the boss feature is finalized to avoid churn.
|
|
- Version groups must exist for boss battle API calls to work — check if `app.seeds` already seeds them.
|