From 2a9f6924799045b486f12a229dbee572929f3d3a Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Sun, 18 Dec 2022 20:41:59 +0100 Subject: [PATCH] fix(frontend): Fix common modal test Signed-off-by: Tilman Vatteroth --- .../modals/__snapshots__/common-modal.test.tsx.snap | 8 ++++++-- .../src/components/common/modals/common-modal.test.tsx | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/common/modals/__snapshots__/common-modal.test.tsx.snap b/frontend/src/components/common/modals/__snapshots__/common-modal.test.tsx.snap index bf2744106..f9151276c 100644 --- a/frontend/src/components/common/modals/__snapshots__/common-modal.test.tsx.snap +++ b/frontend/src/components/common/modals/__snapshots__/common-modal.test.tsx.snap @@ -95,7 +95,9 @@ exports[`CommonModal render correctly with i18nTitle 1`] = ` > testText @@ -115,7 +117,9 @@ exports[`CommonModal render correctly with title 1`] = ` > testText diff --git a/frontend/src/components/common/modals/common-modal.test.tsx b/frontend/src/components/common/modals/common-modal.test.tsx index 736fd64ee..5b4d42949 100644 --- a/frontend/src/components/common/modals/common-modal.test.tsx +++ b/frontend/src/components/common/modals/common-modal.test.tsx @@ -3,6 +3,7 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ +import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n' import { CommonModal } from './common-modal' import { fireEvent, render, screen } from '@testing-library/react' import React from 'react' @@ -13,6 +14,10 @@ describe('CommonModal', () => { jest.resetModules() }) + beforeAll(async () => { + await mockI18n() + }) + it('does not render if show is false', () => { const view = render(testText) expect(view.container).toMatchSnapshot()