Fix E2E test reliability issues and stale data bugs
- Fix race conditions: Set workers: 1 since all tests share test user state - Fix stale data: GET /api/user and /api/cycle/current now fetch fresh data from database instead of returning stale PocketBase auth store cache - Fix timing: Replace waitForTimeout with retry-based Playwright assertions - Fix mobile test: Use exact heading match to avoid strict mode violation - Add test user setup: Include notificationTime and update rule for users All 1014 unit tests and 190 E2E tests pass. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -140,15 +140,18 @@ test.describe("mobile viewport", () => {
|
||||
const viewportSize = page.viewportSize();
|
||||
expect(viewportSize?.width).toBe(375);
|
||||
|
||||
// Calendar heading should be visible
|
||||
const heading = page.getByRole("heading", { name: /calendar/i });
|
||||
await expect(heading).toBeVisible();
|
||||
// Calendar page title heading should be visible (exact match to avoid "Calendar Subscription")
|
||||
const heading = page.getByRole("heading", {
|
||||
name: "Calendar",
|
||||
exact: true,
|
||||
});
|
||||
await expect(heading).toBeVisible({ timeout: 10000 });
|
||||
|
||||
// Calendar grid should be visible
|
||||
const calendarGrid = page
|
||||
.getByRole("grid")
|
||||
.or(page.locator('[data-testid="month-view"]'));
|
||||
await expect(calendarGrid).toBeVisible();
|
||||
await expect(calendarGrid).toBeVisible({ timeout: 5000 });
|
||||
|
||||
// Month navigation should be visible
|
||||
const monthYear = page.getByText(
|
||||
|
||||
Reference in New Issue
Block a user