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
27 changes: 17 additions & 10 deletions tests/e2e/spec-coverage/queue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,24 @@ test.describe('Queue', () => {
// The seeded instance carries assigned cases and closed cases, so a queue
// returning the same count as All cases means the base filter never
// reached the query.
await page.goto('/index.php/apps/dossiq/cases')
await expect(page.locator('[data-testid="cn-page"]')).toBeVisible({
timeout: 60_000,
})
const allRows = await page.locator('table tbody tr').count()
//
// Count only once a row is ON the page. `cn-page` becomes visible while
// the table is still fetching, so counting on that signal alone read 0
// rows from a page that was about to render 9 — and `4 < 0` is false, so
// the assertion failed against a perfectly correct queue.
const countRows = async (path: string): Promise<number> => {
await page.goto(path)
await expect(page.locator('[data-testid="cn-page"]')).toBeVisible({
timeout: 60_000,
})
await expect(page.locator('table tbody tr').first()).toBeVisible({
timeout: 60_000,
})
return await page.locator('table tbody tr').count()
}

await page.goto('/index.php/apps/dossiq/queue')
await expect(page.locator('[data-testid="cn-page"]')).toBeVisible({
timeout: 60_000,
})
const queueRows = await page.locator('table tbody tr').count()
const allRows = await countRows('/index.php/apps/dossiq/cases')
const queueRows = await countRows('/index.php/apps/dossiq/queue')

expect(
queueRows,
Expand Down
Loading