Re-write test with storybook testing library (#150)

* Re-write test with storybook testing library

* Update CI
This commit is contained in:
Charles Bochet
2023-05-29 11:02:38 +02:00
committed by GitHub
parent 8f88605f32
commit f935a6b723
65 changed files with 8085 additions and 5164 deletions

View File

@ -1,19 +0,0 @@
import { MemoryRouter } from 'react-router-dom';
import Callback from '../Callback';
import { ThemeProvider } from '@emotion/react';
import { lightTheme } from '../../../layout/styles/themes';
const component = {
title: 'Callback',
component: Callback,
};
export default component;
export const CallbackDefault = () => (
<ThemeProvider theme={lightTheme}>
<MemoryRouter>
<Callback />
</MemoryRouter>
</ThemeProvider>
);

View File

@ -1,19 +0,0 @@
import { MemoryRouter } from 'react-router-dom';
import Login from '../Login';
import { ThemeProvider } from '@emotion/react';
import { lightTheme } from '../../../layout/styles/themes';
const component = {
title: 'Login',
component: Login,
};
export default component;
export const LoginDefault = () => (
<ThemeProvider theme={lightTheme}>
<MemoryRouter>
<Login />
</MemoryRouter>
</ThemeProvider>
);

View File

@ -1,10 +0,0 @@
import { render } from '@testing-library/react';
import { CallbackDefault } from '../__stories__/Callback.stories';
import { act } from 'react-dom/test-utils';
it('Checks the Callback page render', async () => {
await act(async () => {
render(<CallbackDefault />);
});
});

View File

@ -1,15 +0,0 @@
import { render } from '@testing-library/react';
import { LoginDefault } from '../__stories__/Login.stories';
const assignMock = jest.fn();
delete window.location;
window.location = { assign: assignMock };
afterEach(() => {
assignMock.mockClear();
});
it('Checks the Login page render', () => {
render(<LoginDefault />);
});