mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-29 01:54:21 -05:00
test: add tests for translated-external-link
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
857f808893
commit
055bb6fcfd
2 changed files with 35 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`TranslatedExternalLink renders with i18nKey 1`] = `
|
||||||
|
<div>
|
||||||
|
<a
|
||||||
|
class="text-light"
|
||||||
|
dir="auto"
|
||||||
|
href="https://example.com"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
testi18nKey
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
`;
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { TranslatedExternalLink } from './translated-external-link'
|
||||||
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
|
import { render } from '@testing-library/react'
|
||||||
|
|
||||||
|
describe('TranslatedExternalLink', () => {
|
||||||
|
const href = 'https://example.com'
|
||||||
|
beforeAll(async () => {
|
||||||
|
await mockI18n()
|
||||||
|
})
|
||||||
|
it('renders with i18nKey', () => {
|
||||||
|
const view = render(<TranslatedExternalLink i18nKey={'testi18nKey'} href={href} />)
|
||||||
|
expect(view.container).toMatchSnapshot()
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in a new issue