test(front): add test suite frontend (WIP)

This commit is contained in:
jubnl
2026-04-07 12:31:09 +02:00
parent 96080e8a03
commit 3c31902885
97 changed files with 16973 additions and 4 deletions
+26
View File
@@ -0,0 +1,26 @@
import React from 'react';
import { render, type RenderOptions } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import { TranslationProvider } from '../../src/i18n/TranslationContext';
interface RenderWithProvidersOptions extends Omit<RenderOptions, 'wrapper'> {
initialEntries?: string[];
}
function renderWithProviders(
ui: React.ReactElement,
{ initialEntries = ['/'], ...options }: RenderWithProvidersOptions = {},
) {
function Wrapper({ children }: { children: React.ReactNode }) {
return (
<MemoryRouter initialEntries={initialEntries}>
<TranslationProvider>{children}</TranslationProvider>
</MemoryRouter>
);
}
return render(ui, { wrapper: Wrapper, ...options });
}
export * from '@testing-library/react';
export { renderWithProviders as render };