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
21 changes: 17 additions & 4 deletions tests/e2e/spec-coverage/task-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,26 @@ test.describe('Task Management spec coverage', () => {
page,
}) => {
await page.goto('/index.php/apps/dossiq/tasks')
// CnIndexPage renders with Add Task button and "No items found" empty state
// CnIndexPage renders with its Add Task button.
await expect(page.getByRole('button', { name: 'Add Task' })).toBeVisible({
timeout: 10000,
})
await expect(page.getByText('No items found')).toBeVisible({
timeout: 10000,
})
// The scenario is "view the global task list", so the list must RENDER.
// It used to assert "No items found" outright, which made the test
// require an empty register: the shared instance carries 8 task rows and
// the assertion could only fail. Rows are a better satisfaction of the
// scenario than emptiness, so accept either and reject neither.
await expect
.poll(
async () =>
(await page.locator('tbody tr').count()) > 0
|| (await page.getByText('No items found').count()) > 0,
{
timeout: 10000,
message: 'the task list rendered either rows or its empty state',
},
)
.toBe(true)
// Should not show broken state
await expect(page.locator('body')).not.toContainText('Internal Server Error')
})
Expand Down
Loading