mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 03:05:19 -04:00
fix(frontend): Await act calls in tests
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
2206349415
commit
614374768a
6 changed files with 11 additions and 11 deletions
|
@ -47,7 +47,7 @@ describe('AliasesAddForm', () => {
|
|||
const input = await screen.findByTestId('addAliasInput')
|
||||
await testEvent.type(input, 'abc')
|
||||
expect(button).toBeEnabled()
|
||||
act(() => {
|
||||
await act(() => {
|
||||
button.click()
|
||||
})
|
||||
expect(AliasModule.addAlias).toBeCalledWith('mock-note', 'abc')
|
||||
|
|
|
@ -47,7 +47,7 @@ describe('AliasesListEntry', () => {
|
|||
const view = render(<AliasesListEntry alias={testAlias} />)
|
||||
expect(view.container).toMatchSnapshot()
|
||||
const button = await screen.findByTestId('aliasButtonRemove')
|
||||
act(() => {
|
||||
await act(() => {
|
||||
button.click()
|
||||
})
|
||||
expect(AliasModule.deleteAlias).toBeCalledWith(testAlias.name)
|
||||
|
@ -64,14 +64,14 @@ describe('AliasesListEntry', () => {
|
|||
const view = render(<AliasesListEntry alias={testAlias} />)
|
||||
expect(view.container).toMatchSnapshot()
|
||||
const buttonRemove = await screen.findByTestId('aliasButtonRemove')
|
||||
act(() => {
|
||||
await act(() => {
|
||||
buttonRemove.click()
|
||||
})
|
||||
expect(AliasModule.deleteAlias).toBeCalledWith(testAlias.name)
|
||||
await deletePromise
|
||||
expect(NoteDetailsReduxModule.updateMetadata).toBeCalled()
|
||||
const buttonMakePrimary = await screen.findByTestId('aliasButtonMakePrimary')
|
||||
act(() => {
|
||||
await act(() => {
|
||||
buttonMakePrimary.click()
|
||||
})
|
||||
expect(AliasModule.markAliasAsPrimary).toBeCalledWith(testAlias.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue