test: Update event summary security test to check for login prompt instead of redirect

This commit is contained in:
bengizmo 2025-05-20 08:30:52 -03:00
parent e492f7fec3
commit b54f544713

View file

@ -157,15 +157,15 @@ test.describe('Event Summary Page', () => {
await expect(viewPublicLink).toBeVisible(); 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 // Log out first
await page.goto('/wp-login.php?action=logout'); 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 // Try to access event summary page directly
await page.goto(`/event-summary/?event_id=${testEventId}`, { timeout: 30000 }); await page.goto(`/event-summary/?event_id=${testEventId}`);
// Should redirect to login page - increase timeout for redirect // Should not show event summary content
await expect(page).toHaveURL(/.*\/community-login.*/, { timeout: 10000 }); 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 });
}); });
}); });