mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-28 17:01:00 -05:00
refactor: move mockI18n
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
c6ce0bc704
commit
00be642c26
35 changed files with 36 additions and 36 deletions
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { AsyncLoadingBoundary } from './async-loading-boundary'
|
||||
import { render } from '@testing-library/react'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { CustomAsyncLoadingBoundary } from './custom-async-loading-boundary'
|
||||
import { render } from '@testing-library/react'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import { CopyToClipboardButton } from './copy-to-clipboard-button'
|
||||
import { act, render, screen } from '@testing-library/react'
|
||||
import React from 'react'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { TranslatedExternalLink } from './translated-external-link'
|
||||
import { render } from '@testing-library/react'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { TranslatedInternalLink } from './translated-internal-link'
|
||||
import { render } from '@testing-library/react'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { CommonModal } from './common-modal'
|
||||
import { fireEvent, render, screen } from '@testing-library/react'
|
||||
import React from 'react'
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { mockNoteOwnership } from '../../../test-utils/note-ownership'
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { DeletionModal } from './deletion-modal'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import * as UseBaseUrlModule from '../../../hooks/common/use-base-url'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { testId } from '../../../utils/test-id'
|
||||
import * as RenderIframeModule from '../../editor-page/renderer-pane/render-iframe'
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import type { CommonModalProps } from '../modals/common-modal'
|
||||
import * as CommonModalModule from '../modals/common-modal'
|
||||
import * as fetchMotdModule from './fetch-motd'
|
||||
|
@ -22,7 +22,7 @@ jest.mock('../../../hooks/common/use-base-url')
|
|||
|
||||
describe('motd modal', () => {
|
||||
beforeAll(async () => {
|
||||
jest.spyOn(UseBaseUrlModule, 'useBaseUrl').mockImplementation(() => new URL('https://example.org'))
|
||||
jest.spyOn(UseBaseUrlModule, 'useBaseUrl').mockImplementation(() => 'https://example.org')
|
||||
await mockI18n()
|
||||
})
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import * as createNoteWithPrimaryAliasModule from '../../../api/notes'
|
||||
import type { Note, NoteMetadata } from '../../../api/notes/types'
|
||||
import * as useSingleStringUrlParameterModule from '../../../hooks/common/use-single-string-url-parameter'
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { CreateNonExistingNoteHint } from './create-non-existing-note-hint'
|
||||
import { waitForOtherPromisesToFinish } from '@hedgedoc/commons'
|
||||
import { act, render, screen, waitFor } from '@testing-library/react'
|
||||
|
|
|
@ -9,9 +9,9 @@ import type { Note } from '../../../api/notes/types'
|
|||
import * as LoadingScreenModule from '../../../components/application-loader/loading-screen/loading-screen'
|
||||
import * as useSingleStringUrlParameterModule from '../../../hooks/common/use-single-string-url-parameter'
|
||||
import * as setNoteDataFromServerModule from '../../../redux/note-details/methods'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { testId } from '../../../utils/test-id'
|
||||
import * as CommonErrorPageModule from '../../error-pages/common-error-page'
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import * as CreateNonExistingNoteHintModule from './create-non-existing-note-hint'
|
||||
import { NoteLoadingBoundary } from './note-loading-boundary'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { UserInfo } from '../../../api/users/types'
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { UserAvatarForUser } from './user-avatar-for-user'
|
||||
import { render } from '@testing-library/react'
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
import * as AliasModule from '../../../../api/alias'
|
||||
import * as NoteDetailsReduxModule from '../../../../redux/note-details/methods'
|
||||
import type { NoteDetails } from '../../../../redux/note-details/types/note-details'
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import { mockNoteOwnership } from '../../../../test-utils/note-ownership'
|
||||
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
||||
import * as useUiNotificationsModule from '../../../notifications/ui-notification-boundary'
|
||||
import { AliasesAddForm } from './aliases-add-form'
|
||||
import { render, act, screen } from '@testing-library/react'
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
import * as AliasModule from '../../../../api/alias'
|
||||
import type { Alias } from '../../../../api/alias/types'
|
||||
import * as NoteDetailsReduxModule from '../../../../redux/note-details/methods'
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import { mockNoteOwnership } from '../../../../test-utils/note-ownership'
|
||||
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
||||
import * as useUiNotificationsModule from '../../../notifications/ui-notification-boundary'
|
||||
import { AliasesListEntry } from './aliases-list-entry'
|
||||
import { render, act, screen } from '@testing-library/react'
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
import type { Alias } from '../../../../api/alias/types'
|
||||
import * as useApplicationStateModule from '../../../../hooks/common/use-application-state'
|
||||
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import { AliasesList } from './aliases-list'
|
||||
import * as AliasesListEntryModule from './aliases-list-entry'
|
||||
import type { AliasesListEntryProps } from './aliases-list-entry'
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import type { CommonModalProps } from '../../../common/modals/common-modal'
|
||||
import * as CommonModalModule from '../../../common/modals/common-modal'
|
||||
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
||||
import * as useUiNotificationsModule from '../../../notifications/ui-notification-boundary'
|
||||
import * as AliasesAddFormModule from './aliases-add-form'
|
||||
import * as AliasesListModule from './aliases-list'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import { FrontmatterLinter } from './frontmatter-linter'
|
||||
import { mockEditorView } from './single-line-regex-linter.spec'
|
||||
import type { Diagnostic } from '@codemirror/lint'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import { SingleLineRegexLinter } from './single-line-regex-linter'
|
||||
import type { Diagnostic } from '@codemirror/lint'
|
||||
import type { EditorState, Text } from '@codemirror/state'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import * as UseApplicationStateModule from '../../../hooks/common/use-application-state'
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { RealtimeConnectionAlert } from './realtime-connection-alert'
|
||||
import { render } from '@testing-library/react'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { TableOfContents } from './table-of-contents'
|
||||
import type { TocAst } from '@hedgedoc/markdown-it-plugins'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import { OnOffButtonGroup } from './on-off-button-group'
|
||||
import { act, render, screen } from '@testing-library/react'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../test-utils/test-markdown-renderer'
|
||||
import { EmojiMarkdownExtension } from './emoji-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../../test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../test-utils/test-markdown-renderer'
|
||||
import { LinkifyFixMarkdownExtension } from './linkify-fix-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { AbcFrame } from './abc-frame'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import React from 'react'
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import * as AbcFrameModule from './abc-frame'
|
||||
import { AbcjsMarkdownExtension } from './abcjs-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { IdProps } from '../../../components/markdown-renderer/replace-components/custom-tag-with-id-component-replacer'
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import * as AsciinemaFrameModule from './asciinema-frame'
|
||||
import { AsciinemaMarkdownExtension } from './asciinema-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import * as CsvTableModule from '../csv/csv-table'
|
||||
import { CsvTableMarkdownExtension } from './csv-table-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import * as Flowchart from '../flowchart/flowchart'
|
||||
import { FlowchartMarkdownExtension } from './flowchart-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { StoreProvider } from '../../../redux/store-provider'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { FlowChart } from './flowchart'
|
||||
import * as useMediaQuery from '@restart/hooks/useMediaQuery'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import * as GraphvizFrameModule from '../graphviz/graphviz-frame'
|
||||
import { GraphvizMarkdownExtension } from './graphviz-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import type { HighlightedCodeProps } from './highlighted-code'
|
||||
import * as HighlightedCodeModule from './highlighted-code'
|
||||
import { HighlightedCodeMarkdownExtension } from './highlighted-code-markdown-extension'
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import HighlightedCode from './highlighted-code'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import { PlantumlMarkdownExtension } from './plantuml-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
import React from 'react'
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { CodeProps } from '../../../components/markdown-renderer/replace-components/code-block-component-replacer'
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import * as VegaLiteChartModule from '../vega-lite/vega-lite-chart'
|
||||
import { VegaLiteMarkdownExtension } from './vega-lite-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import type { IdProps } from '../../../components/markdown-renderer/replace-components/custom-tag-with-id-component-replacer'
|
||||
import { mockI18n } from '../../../components/markdown-renderer/test-utils/mock-i18n'
|
||||
import { TestMarkdownRenderer } from '../../../components/markdown-renderer/test-utils/test-markdown-renderer'
|
||||
import { mockI18n } from '../../../test-utils/mock-i18n'
|
||||
import * as YouTubeFrameModule from './youtube-frame'
|
||||
import { YoutubeMarkdownExtension } from './youtube-markdown-extension'
|
||||
import { render } from '@testing-library/react'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
Loading…
Reference in a new issue