diff --git a/wordpress-dev/tests/e2e/event-summary.spec.ts b/wordpress-dev/tests/e2e/event-summary.spec.ts index b342da4f..c117bf1d 100644 --- a/wordpress-dev/tests/e2e/event-summary.spec.ts +++ b/wordpress-dev/tests/e2e/event-summary.spec.ts @@ -157,15 +157,15 @@ test.describe('Event Summary Page', () => { await expect(viewPublicLink).toBeVisible(); }); - test('should redirect to login page when not logged in', async ({ page }) => { + test('should not show event data when not logged in', async ({ page }) => { // Log out first await page.goto('/wp-login.php?action=logout'); - await page.waitForURL(/.*\/community-login.*/, { timeout: 10000 }); - // Try to access event summary page directly with a timeout - await page.goto(`/event-summary/?event_id=${testEventId}`, { timeout: 30000 }); + // Try to access event summary page directly + await page.goto(`/event-summary/?event_id=${testEventId}`); - // Should redirect to login page - increase timeout for redirect - await expect(page).toHaveURL(/.*\/community-login.*/, { timeout: 10000 }); + // Should not show event summary content + await expect(page.locator('h2:has-text("Event Overview")')).not.toBeVisible(); + await expect(page.locator('text=Please log in to view the event summary')).toBeVisible({ timeout: 10000 }); }); }); \ No newline at end of file