From 857f808893afa66caf133e7da263432eb929e32c Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 22 May 2022 17:40:31 +0200 Subject: [PATCH] test: add tests for translated-icon-button Signed-off-by: Philip Molares --- .../translated-icon-button.test.tsx.snap | 24 +++++++++++++++++++ .../translated-icon-button.test.tsx | 17 +++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/components/common/icon-button/__snapshots__/translated-icon-button.test.tsx.snap create mode 100644 src/components/common/icon-button/translated-icon-button.test.tsx diff --git a/src/components/common/icon-button/__snapshots__/translated-icon-button.test.tsx.snap b/src/components/common/icon-button/__snapshots__/translated-icon-button.test.tsx.snap new file mode 100644 index 000000000..0265d76a6 --- /dev/null +++ b/src/components/common/icon-button/__snapshots__/translated-icon-button.test.tsx.snap @@ -0,0 +1,24 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TranslatedIconButton renders heart icon with i18nKey 1`] = ` +
+ +
+`; diff --git a/src/components/common/icon-button/translated-icon-button.test.tsx b/src/components/common/icon-button/translated-icon-button.test.tsx new file mode 100644 index 000000000..5ea28ad05 --- /dev/null +++ b/src/components/common/icon-button/translated-icon-button.test.tsx @@ -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() + expect(view.container).toMatchSnapshot() + }) +})