fix(frontend): Await act calls in tests

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-11-21 16:55:49 +01:00
parent 2206349415
commit 614374768a
6 changed files with 11 additions and 11 deletions

View file

@ -18,7 +18,7 @@ describe('Settings On-Off Button Group', () => {
const view = render(<OnOffButtonGroup value={value} onSelect={onSelect} />)
expect(view.container).toMatchSnapshot()
const onButton = await screen.findByTestId('onOffButtonGroupOn')
act(() => {
await act(() => {
onButton.click()
})
expect(value).toBeTruthy()
@ -26,7 +26,7 @@ describe('Settings On-Off Button Group', () => {
view.rerender(<OnOffButtonGroup value={value} onSelect={onSelect} />)
expect(view.container).toMatchSnapshot()
const offButton = await screen.findByTestId('onOffButtonGroupOff')
act(() => {
await act(() => {
offButton.click()
})
expect(value).toBeFalsy()