Skip to content
Snippets Groups Projects
Commit 041ee66a authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

Merge branch 'rtl/splash' into 'dev'

test(rtl): splash

See merge request !1057
parents 84f16af3 9cdfbf12
Branches
Tags
2 merge requests!10622.7 Release,!1057test(rtl): splash
import Button from '@material-ui/core/Button'
import { render, screen } from '@testing-library/react'
import { userEvent } from '@testing-library/user-event'
import { mount } from 'enzyme'
import toJson from 'enzyme-to-json'
import { InitStepsErrors } from 'models/initialisationSteps.model'
......@@ -23,11 +24,9 @@ describe('SplashScreenError component', () => {
)
expect(toJson(component)).toMatchSnapshot()
})
it('should reload the page', () => {
const component = mount(
<SplashScreenError error={InitStepsErrors.CONSENT_ERROR} />
)
component.find(Button).first().simulate('click')
it('should reload the page', async () => {
render(<SplashScreenError error={InitStepsErrors.CONSENT_ERROR} />)
await userEvent.click(screen.getByRole('button'))
expect(window.location.reload).toHaveBeenCalled()
})
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment