fix(frontend): Add generic type to act calls to trigger promise generation

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-12-24 14:36:05 +01:00
parent e5359a69ca
commit 9c3858797f
6 changed files with 11 additions and 11 deletions
frontend/src/components/common
copyable/copy-to-clipboard-button
motd-modal
note-loading-boundary

View file

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

View file

@ -60,7 +60,7 @@ describe('motd modal', () => {
expect(view.container).toMatchSnapshot()
const button = await screen.findByTestId('motd-dismiss')
await act(() => {
await act<void>(() => {
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')
await act(() => {
await act<void>(() => {
button.click()
})
await waitFor(async () => {
@ -92,7 +92,7 @@ describe('create non existing note hint', () => {
const onNoteCreatedCallback = jest.fn()
const view = render(<CreateNonExistingNoteHint onNoteCreated={onNoteCreatedCallback}></CreateNonExistingNoteHint>)
const button = await screen.findByTestId('createNoteButton')
await act(() => {
await act<void>(() => {
button.click()
})
await waitFor(async () => {
@ -107,7 +107,7 @@ describe('create non existing note hint', () => {
const onNoteCreatedCallback = jest.fn()
const view = render(<CreateNonExistingNoteHint onNoteCreated={onNoteCreatedCallback}></CreateNonExistingNoteHint>)
const button = await screen.findByTestId('createNoteButton')
await act(() => {
await act<void>(() => {
button.click()
})
await waitFor(async () => {