mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
fix(frontend): verify that callback could be run in create-non-existing-note-hint.test.tsx
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
5f238e9651
commit
eacd81cb9c
1 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -68,6 +68,7 @@ describe('create non existing note hint', () => {
|
|||
const onNoteCreatedCallback = jest.fn()
|
||||
const view = render(<CreateNonExistingNoteHint onNoteCreated={onNoteCreatedCallback}></CreateNonExistingNoteHint>)
|
||||
await screen.findByTestId('createNoteMessage')
|
||||
await waitForOtherPromisesToFinish()
|
||||
expect(onNoteCreatedCallback).not.toBeCalled()
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
|
@ -83,6 +84,7 @@ describe('create non existing note hint', () => {
|
|||
await waitFor(async () => {
|
||||
expect(await screen.findByTestId('loadingMessage')).toBeInTheDocument()
|
||||
})
|
||||
await waitForOtherPromisesToFinish()
|
||||
expect(onNoteCreatedCallback).not.toBeCalled()
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
|
@ -98,6 +100,7 @@ describe('create non existing note hint', () => {
|
|||
await waitFor(async () => {
|
||||
expect(await screen.findByTestId('noteCreated')).toBeInTheDocument()
|
||||
})
|
||||
await waitForOtherPromisesToFinish()
|
||||
expect(onNoteCreatedCallback).toBeCalled()
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
|
@ -113,6 +116,7 @@ describe('create non existing note hint', () => {
|
|||
await waitFor(async () => {
|
||||
expect(await screen.findByTestId('failedMessage')).toBeInTheDocument()
|
||||
})
|
||||
await waitForOtherPromisesToFinish()
|
||||
expect(onNoteCreatedCallback).not.toBeCalled()
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue