mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04: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
|
<div
|
||||||
class="modal-title h4"
|
class="modal-title h4"
|
||||||
/>
|
>
|
||||||
|
testTitle
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
testText
|
testText
|
||||||
</div>
|
</div>
|
||||||
|
@ -115,7 +117,9 @@ exports[`CommonModal render correctly with title 1`] = `
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="modal-title h4"
|
class="modal-title h4"
|
||||||
/>
|
>
|
||||||
|
testTitle
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
testText
|
testText
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
import { CommonModal } from './common-modal'
|
import { CommonModal } from './common-modal'
|
||||||
import { fireEvent, render, screen } from '@testing-library/react'
|
import { fireEvent, render, screen } from '@testing-library/react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
@ -13,6 +14,10 @@ describe('CommonModal', () => {
|
||||||
jest.resetModules()
|
jest.resetModules()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
await mockI18n()
|
||||||
|
})
|
||||||
|
|
||||||
it('does not render if show is false', () => {
|
it('does not render if show is false', () => {
|
||||||
const view = render(<CommonModal show={false}>testText</CommonModal>)
|
const view = render(<CommonModal show={false}>testText</CommonModal>)
|
||||||
expect(view.container).toMatchSnapshot()
|
expect(view.container).toMatchSnapshot()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue