forked from cardosofelipe/fast-next-template
- 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.
24 lines
486 B
TypeScript
24 lines
486 B
TypeScript
/**
|
|
* 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(),
|
|
}),
|
|
});
|