mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-01-23 05:12:23 +00:00
fix(frontend): Fix common modal test
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
68e2a9518c
commit
2a9f692479
2 changed files with 11 additions and 2 deletions
|
@ -95,7 +95,9 @@ exports[`CommonModal render correctly with i18nTitle 1`] = `
|
|||
>
|
||||
<div
|
||||
class="modal-title h4"
|
||||
/>
|
||||
>
|
||||
testTitle
|
||||
</div>
|
||||
</div>
|
||||
testText
|
||||
</div>
|
||||
|
@ -115,7 +117,9 @@ exports[`CommonModal render correctly with title 1`] = `
|
|||
>
|
||||
<div
|
||||
class="modal-title h4"
|
||||
/>
|
||||
>
|
||||
testTitle
|
||||
</div>
|
||||
</div>
|
||||
testText
|
||||
</div>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { CommonModal } from './common-modal'
|
||||
import { fireEvent, render, screen } from '@testing-library/react'
|
||||
import React from 'react'
|
||||
|
@ -13,6 +14,10 @@ describe('CommonModal', () => {
|
|||
jest.resetModules()
|
||||
})
|
||||
|
||||
beforeAll(async () => {
|
||||
await mockI18n()
|
||||
})
|
||||
|
||||
it('does not render if show is false', () => {
|
||||
const view = render(<CommonModal show={false}>testText</CommonModal>)
|
||||
expect(view.container).toMatchSnapshot()
|
||||
|
|
Loading…
Reference in a new issue