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

@ -40,7 +40,7 @@ describe('Copy to clipboard button', () => {
const view = render(copyToClipboardButton)
expect(view.container).toMatchSnapshot()
const button = await screen.findByTitle('renderer.highlightCode.copyCode')
act(() => {
await act(() => {
button.click()
})
const tooltip = await screen.findByRole('tooltip')

View file

@ -61,7 +61,7 @@ describe('motd modal', () => {
expect(view.container).toMatchSnapshot()
const button = await screen.findByTestId('motd-dismiss')
act(() => {
await act(() => {
button.click()
})
expect(view.container).toMatchSnapshot()

View file

@ -77,7 +77,7 @@ describe('create non existing note hint', () => {
const onNoteCreatedCallback = jest.fn()
const view = render(<CreateNonExistingNoteHint onNoteCreated={onNoteCreatedCallback}></CreateNonExistingNoteHint>)
const button = await screen.findByTestId('createNoteButton')
act(() => {
await act(() => {
button.click()
})
await screen.findByTestId('loadingMessage')
@ -90,7 +90,7 @@ describe('create non existing note hint', () => {
const onNoteCreatedCallback = jest.fn()
const view = render(<CreateNonExistingNoteHint onNoteCreated={onNoteCreatedCallback}></CreateNonExistingNoteHint>)
const button = await screen.findByTestId('createNoteButton')
act(() => {
await act(() => {
button.click()
})
await screen.findByTestId('noteCreated')
@ -103,7 +103,7 @@ describe('create non existing note hint', () => {
const onNoteCreatedCallback = jest.fn()
const view = render(<CreateNonExistingNoteHint onNoteCreated={onNoteCreatedCallback}></CreateNonExistingNoteHint>)
const button = await screen.findByTestId('createNoteButton')
act(() => {
await act(() => {
button.click()
})
await screen.findByTestId('failedMessage')