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

@@ -0,0 +1,23 @@
/**
* Mock for next-intl/routing
*/
export const defineRouting = (config: any) => config;
export const createNavigation = (_routing: any) => ({
Link: ({ children, href, ...props }: any) => (
<a href={href} {...props}>
{children}
</a>
),
redirect: jest.fn(),
usePathname: () => '/en/test',
useRouter: () => ({
push: jest.fn(),
replace: jest.fn(),
prefetch: jest.fn(),
back: jest.fn(),
forward: jest.fn(),
refresh: jest.fn(),
}),
});