mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-16 17:01:37 +00:00
test: add tests for translated-internal-link
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
055bb6fcfd
commit
5de4afc9fc
2 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,12 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`TranslatedInternalLink renders with i18nKey 1`] = `
|
||||
<div>
|
||||
<a
|
||||
class="text-light"
|
||||
href="/test"
|
||||
>
|
||||
testi18nKey
|
||||
</a>
|
||||
</div>
|
||||
`;
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { TranslatedInternalLink } from './translated-internal-link'
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { render } from '@testing-library/react'
|
||||
|
||||
describe('TranslatedInternalLink', () => {
|
||||
const href = '/test'
|
||||
beforeAll(async () => {
|
||||
await mockI18n()
|
||||
})
|
||||
it('renders with i18nKey', () => {
|
||||
const view = render(<TranslatedInternalLink i18nKey={'testi18nKey'} href={href} />)
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue