fix: add timeout: 0 to E2E assertions that check for absence of elements (#26353)

This fixes hanging E2E tests where assertions like toHaveCount(0) and
not.toBeVisible() would wait for the full timeout (10s in CI, 120s locally)
before failing, instead of failing immediately.

These assertions are 'state check' assertions that verify an element is
already absent or hidden, rather than waiting for it to become so.
Adding { timeout: 0 } makes them fail immediately if the condition is not met.

Files updated:
- locale.e2e.ts: 16 instances of toHaveCount(0)
- booking-seats.e2e.ts: 8 instances of toHaveCount(0)
- organization-redirection.e2e.ts: 3 instances of toHaveCount(0)
- organization-creation-flows.e2e.ts: 5 instances of not.toBeVisible()
- insights-charts.e2e.ts: 1 instance of toHaveCount(0)
- bookings-list.e2e.ts: 1 instance of toHaveCount(0)
- availability.e2e.ts: 1 instance of toHaveCount(0)
- managed-event-types.e2e.ts: 1 instance of toHaveCount(0)
- team-invitation.e2e.ts: 1 instance of toHaveCount(0)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Keith WilliamsandDevin AI authored and GitHub committed 2025-12-31 14:58:20 -03:00
1 parent 4563194fcf
commit 486817a688
9 files changed
+34 -34

No files matched your search

@@ -242,8 +242,8 @@ test.describe("Organization Creation Flows - Comprehensive Suite", () => {
// Verify billing fields are NOT visible to regular users
if (IS_TEAM_BILLING_ENABLED) {
await expect(page.locator("input[name=seats]")).not.toBeVisible();
await expect(page.locator("input[name=pricePerSeat]")).not.toBeVisible();
await expect(page.locator("input[name=seats]")).not.toBeVisible({ timeout: 0 });
await expect(page.locator("input[name=pricePerSeat]")).not.toBeVisible({ timeout: 0 });
// Verify "Upgrade to Organizations" UI is shown
await expect(page.getByText(/upgrade to organizations/i)).toBeVisible();
@@ -439,9 +439,9 @@ test.describe("Organization Creation Flows - Comprehensive Suite", () => {
await page.goto("/settings/organizations/new");
// Should NOT see admin billing fields
await expect(page.locator("input[name=seats]")).not.toBeVisible();
await expect(page.locator("input[name=pricePerSeat]")).not.toBeVisible();
await expect(page.locator("#billingPeriod")).not.toBeVisible();
await expect(page.locator("input[name=seats]")).not.toBeVisible({ timeout: 0 });
await expect(page.locator("input[name=pricePerSeat]")).not.toBeVisible({ timeout: 0 });
await expect(page.locator("#billingPeriod")).not.toBeVisible({ timeout: 0 });
// Should see upgrade/pricing UI
await expect(page.getByText(/upgrade to organizations/i)).toBeVisible();
@@ -57,7 +57,7 @@ test.describe("Unpublished Organization Redirection", () => {
await expect(page.getByTestId("empty-screen")).toBeVisible();
// Ensure that the team name is not displayed.
await expect(page.getByTestId("team-name")).toHaveCount(0);
await expect(page.getByTestId("team-name")).toHaveCount(0, { timeout: 0 });
});
});
@@ -101,8 +101,8 @@ test.describe("Unpublished Organization Redirection", () => {
await expect(page.getByTestId("empty-screen")).toBeVisible();
// Ensure user profile elements are not visible.
await expect(page.locator('[data-testid="name-title"]')).toHaveCount(0);
await expect(page.locator('[data-testid="event-types"]')).toHaveCount(0);
await expect(page.locator('[data-testid="name-title"]')).toHaveCount(0, { timeout: 0 });
await expect(page.locator('[data-testid="event-types"]')).toHaveCount(0, { timeout: 0 });
});
});