Re-write test with storybook testing library (#150)
* Re-write test with storybook testing library * Update CI
This commit is contained in:
@ -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>
|
||||
);
|
||||
@ -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>
|
||||
);
|
||||
@ -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 />);
|
||||
});
|
||||
});
|
||||
@ -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 />);
|
||||
});
|
||||
Reference in New Issue
Block a user