Skip to content

Commit 76d9ce0

Browse files
committed
test(e2e): fix Phase 1 spec timing (UX-1208)
Both fixes surfaced by running the suite locally: - quota-error INTERNAL: query-client retries Code.Internal up to 4× with exponential backoff (~7s of delay), so the Alert appears after >10s. Bump assertion timeout to 30s. - user-delete-error: sonner toasts do not survive page navigation. Move the toast assertion before the /security/users reload step.
1 parent 356ee18 commit 76d9ce0

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

frontend/tests/test-variant-console/acls/user-delete-error.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ test.describe('User deletion - error paths', () => {
4141
// Structural: must not navigate to list on failed delete.
4242
await expect(page).toHaveURL(`/security/users/${username}/details`);
4343

44-
// Reload list and confirm the user still appears — deletion truly didn't happen client-side.
45-
await page.goto('/security/users', { waitUntil: 'domcontentloaded' });
46-
await expect(page.getByRole('link', { name: username, exact: true })).toBeVisible({ timeout: 5000 });
47-
4844
// Toast copy: formatToastErrorMessageGRPC composes "Failed to delete user: <rawMessage>".
45+
// Asserted before the list-reload below — sonner toasts do not survive page navigation.
4946
await expect(page.getByText('Failed to delete user: user has dependent ACLs').first()).toBeVisible({
5047
timeout: 10_000,
5148
});
49+
50+
// Reload list and confirm the user still appears — deletion truly didn't happen client-side.
51+
await page.goto('/security/users', { waitUntil: 'domcontentloaded' });
52+
await expect(page.getByRole('link', { name: username, exact: true })).toBeVisible({ timeout: 5000 });
5253
});
5354
});

frontend/tests/test-variant-console/quotas/quota-error.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ test.describe('Quotas page - Connect error handling', () => {
3434
// Error UI: QuotasList renders a Chakra Alert (role="alert") containing the ConnectError
3535
// message when the failure is not permission-related. ConnectError stringifies as
3636
// "[<code>] <rawMessage>", so the mocked rawMessage is the deterministic substring to assert.
37-
await expect(page.getByRole('alert')).toContainText('mocked backend failure', { timeout: 10_000 });
37+
// Timeout accommodates the query-client's exponential-backoff retry policy for Code.Internal
38+
// (4 attempts: 0, 1s, 2s, 4s — see src/query-client.ts).
39+
await expect(page.getByRole('alert')).toContainText('mocked backend failure', { timeout: 30_000 });
3840
});
3941

4042
test('ListQuotas PERMISSION_DENIED surfaces a permission message (not a raw gRPC code)', async ({ page }) => {

0 commit comments

Comments
 (0)