forked from cartsnitch/cartsnitch
fix(e2e): await route mocks and add session mocking to all tests
- Make mockAuthRoutes async and await all page.route() calls to prevent race conditions - Add auth route mocking to J8 unauth tests (required since VITE_MOCK_AUTH was removed) - Add auth route mocking to smoke test - Replace broken mockSessionPending with mockSessionDelayed for spinner test Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -5,7 +5,7 @@ const uniqueEmail = () => `betty+e2e-${Date.now()}@cartsnitch.test`;
|
||||
|
||||
test.describe('J1: Registration and Login', () => {
|
||||
test('can register a new account and lands on dashboard', async ({ page }) => {
|
||||
mockAuthRoutes(page, true);
|
||||
await mockAuthRoutes(page, true);
|
||||
await page.goto('/register');
|
||||
await page.fill('[placeholder="Full Name"]', 'Betty Tester');
|
||||
await page.fill('[placeholder="Email"]', uniqueEmail());
|
||||
@@ -33,7 +33,7 @@ test.describe('J1: Registration and Login', () => {
|
||||
|
||||
test('can sign in with credentials and land on dashboard', async ({ page }) => {
|
||||
const email = uniqueEmail();
|
||||
mockAuthRoutes(page, true);
|
||||
await mockAuthRoutes(page, true);
|
||||
await page.goto('/register');
|
||||
await page.fill('[placeholder="Full Name"]', 'Login Betty');
|
||||
await page.fill('[placeholder="Email"]', email);
|
||||
|
||||
Reference in New Issue
Block a user