Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions tests/e2e/spec-coverage/settings-roadmap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,33 @@ import { dismissSupportDialog } from '../_nav.ts'
const BASE = '/apps/larpinq'

/**
* Hard-load the target in-app route via the app's hash router. The router runs
* in `mode: 'hash'` (src/main.js — fleet #133 deep-link fix), so in-app routes
* are addressed as /apps/larpinq/<route>. Loading that URL serves the SPA
* root from the server (the hash fragment is never sent to the backend, so no
* 404) and the client-side router resolves the view. A fresh load per test
* avoids the shared-list-state collapse where in-session sidebar navigation
* fails to re-key index pages.
* Hard-load the target in-app route.
*
* The router runs in HISTORY mode (`createWebHistory`, src/main.js), so an
* in-app route is a real path: `/apps/larpinq/<route>`, with no `#`. The
* server's SPA catch-all serves the app shell for it and the client router
* resolves the view.
*
* This helper used to assert a `#` in the URL, from when the router ran in hash
* mode. After the move to history mode the app produced
* `/apps/larpinq/features-roadmap` while the assertion still demanded
* `#/features-roadmap`, so six of these tests failed on the URL alone — before
* reaching the `.app-content` gate that is the real check. The app was right.
*
* A fresh load per test avoids the shared-list-state collapse where in-session
* sidebar navigation fails to re-key index pages.
*/
async function openRoute(page: Page, route: string): Promise<void> {
// `domcontentloaded`, never `networkidle` — the latter is unreachable on
// Nextcloud (notification poll), so it just burns the budget (ADR-074
// rule 4). The `.app-content` assertion below is the real readiness gate.
await page.goto(`${BASE}${route}`, { waitUntil: 'domcontentloaded' })
await dismissSupportDialog(page)
await expect(page).toHaveURL(new RegExp(`#${route.replace(/\//g, '\\/')}`))
// Path, not hash. Anchored at the end so `/features-roadmap` cannot be
// satisfied by some longer route that merely contains it.
await expect(page).toHaveURL(
new RegExp(`${route.replace(/\//g, '\\/')}$`),
)
await expect(page.locator('.app-content')).toBeVisible({ timeout: 10_000 })
}

Expand Down
Loading