Update tests and e2e files to support locale-based routing

- Replaced static paths with dynamic locale subpaths (`/[locale]/*`) in imports, URLs, and assertions across tests.
- Updated `next-intl` mocks for improved compatibility with `locale`-aware components.
- Standardized `page.goto` and navigation tests with `/en` as the base locale for consistency.
This commit is contained in:
Felipe Cardoso
2025-11-18 23:26:10 +01:00
parent d1b47006f4
commit da021d0640
42 changed files with 296 additions and 267 deletions

View File

@@ -28,7 +28,7 @@ test.describe('Registration Flow', () => {
});
// Navigate to register page before each test
await page.goto('/register');
await page.goto('/en/register');
});
test.afterEach(async ({ page }, testInfo) => {
@@ -222,10 +222,10 @@ test.describe('Registration Flow', () => {
const loginLink = page.getByRole('link', { name: 'Sign in' });
// Use Promise.all to wait for navigation
await Promise.all([page.waitForURL('/login'), loginLink.click()]);
await Promise.all([page.waitForURL('/en/login'), loginLink.click()]);
// Should be on login page
await expect(page).toHaveURL('/login');
await expect(page).toHaveURL('/en/login');
await expect(page.locator('h2')).toContainText('Sign in to your account');
});