mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(app): introduce react configurations [EE-1809] (#5953)
This commit is contained in:
parent
b285219a58
commit
85a6a80722
50 changed files with 8974 additions and 599 deletions
19
app/react-tools/test-utils.tsx
Normal file
19
app/react-tools/test-utils.tsx
Normal file
|
@ -0,0 +1,19 @@
|
|||
import '@testing-library/jest-dom';
|
||||
|
||||
import { render, RenderOptions } from '@testing-library/react';
|
||||
import { UIRouter, pushStateLocationPlugin } from '@uirouter/react';
|
||||
import { PropsWithChildren, ReactElement } from 'react';
|
||||
|
||||
function Provider({ children }: PropsWithChildren<unknown>) {
|
||||
return <UIRouter plugins={[pushStateLocationPlugin]}>{children}</UIRouter>;
|
||||
}
|
||||
|
||||
function customRender(ui: ReactElement, options?: RenderOptions) {
|
||||
return render(ui, { wrapper: Provider, ...options });
|
||||
}
|
||||
|
||||
// re-export everything
|
||||
export * from '@testing-library/react';
|
||||
|
||||
// override render method
|
||||
export { customRender as render };
|
Loading…
Add table
Add a link
Reference in a new issue