mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 08:34:54 -04:00
test: add tests for translated-icon-button
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
5025d50e9e
commit
857f808893
2 changed files with 41 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`TranslatedIconButton renders heart icon with i18nKey 1`] = `
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
class="btn-icon p-0 d-inline-flex align-items-stretch btn btn-primary"
|
||||||
|
data-testid="icon-button"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="icon-part d-flex align-items-center"
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
class="fa fa-heart icon "
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="text-part d-flex align-items-center"
|
||||||
|
>
|
||||||
|
testi18nKey
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
`;
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||||
|
import { render } from '@testing-library/react'
|
||||||
|
import { TranslatedIconButton } from './translated-icon-button'
|
||||||
|
|
||||||
|
describe('TranslatedIconButton', () => {
|
||||||
|
it('renders heart icon with i18nKey', async () => {
|
||||||
|
await mockI18n()
|
||||||
|
const view = render(<TranslatedIconButton i18nKey={'testi18nKey'} icon={'heart'} />)
|
||||||
|
expect(view.container).toMatchSnapshot()
|
||||||
|
})
|
||||||
|
})
|
Loading…
Add table
Add a link
Reference in a new issue