mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-24 20:14:35 -04:00
Update nextjs monorepo to v12.3.0 (#2222)
* Update nextjs monorepo to v12.3.0 Signed-off-by: Renovate Bot <bot@renovateapp.com> * Fix tests Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Signed-off-by: Renovate Bot <bot@renovateapp.com> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
7d926ca690
commit
7b264042dc
19 changed files with 166 additions and 157 deletions
|
@ -13,6 +13,9 @@ import type { Note, NoteMetadata } from '../../../api/notes/types'
|
|||
import { Mock } from 'ts-mockery'
|
||||
import { waitForOtherPromisesToFinish } from '../../../utils/wait-for-other-promises-to-finish'
|
||||
|
||||
jest.mock('../../../api/notes')
|
||||
jest.mock('../../../hooks/common/use-single-string-url-parameter')
|
||||
|
||||
describe('create non existing note hint', () => {
|
||||
const mockedNoteId = 'mockedNoteId'
|
||||
|
||||
|
|
|
@ -17,6 +17,13 @@ import * as CommonErrorPageModule from '../../error-pages/common-error-page'
|
|||
import * as LoadingScreenModule from '../../../components/application-loader/loading-screen/loading-screen'
|
||||
import * as CreateNonExistingNoteHintModule from './create-non-existing-note-hint'
|
||||
|
||||
jest.mock('../../../hooks/common/use-single-string-url-parameter')
|
||||
jest.mock('../../../api/notes')
|
||||
jest.mock('../../../redux/note-details/methods')
|
||||
jest.mock('../../error-pages/common-error-page')
|
||||
jest.mock('../../../components/application-loader/loading-screen/loading-screen')
|
||||
jest.mock('./create-non-existing-note-hint')
|
||||
|
||||
describe('Note loading boundary', () => {
|
||||
const mockedNoteId = 'mockedNoteId'
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ import type { CodeProps } from '../../replace-components/code-block-component-re
|
|||
import { AbcjsMarkdownExtension } from './abcjs-markdown-extension'
|
||||
import { mockI18n } from '../../test-utils/mock-i18n'
|
||||
|
||||
jest.mock('./abc-frame')
|
||||
|
||||
describe('AbcJs Markdown Extension', () => {
|
||||
beforeAll(async () => {
|
||||
jest.spyOn(AbcFrameModule, 'AbcFrame').mockImplementation((({ code }) => {
|
||||
|
|
|
@ -12,6 +12,8 @@ import { render } from '@testing-library/react'
|
|||
import { TestMarkdownRenderer } from '../../test-utils/test-markdown-renderer'
|
||||
import { CsvTableMarkdownExtension } from './csv-table-markdown-extension'
|
||||
|
||||
jest.mock('../csv/csv-table')
|
||||
|
||||
describe('CSV Table Markdown Extension', () => {
|
||||
beforeAll(async () => {
|
||||
jest.spyOn(CsvTableModule, 'CsvTable').mockImplementation((({ code }) => {
|
||||
|
|
|
@ -12,6 +12,8 @@ import { FlowchartMarkdownExtension } from './flowchart-markdown-extension'
|
|||
import * as Flowchart from '../flowchart/flowchart'
|
||||
import type { CodeProps } from '../../replace-components/code-block-component-replacer'
|
||||
|
||||
jest.mock('../flowchart/flowchart')
|
||||
|
||||
describe('Flowchart markdown extensions', () => {
|
||||
beforeAll(async () => {
|
||||
jest.spyOn(Flowchart, 'FlowChart').mockImplementation((({ code }) => {
|
||||
|
|
|
@ -12,6 +12,8 @@ import { GraphvizMarkdownExtension } from './graphviz-markdown-extension'
|
|||
import * as GraphvizFrameModule from '../graphviz/graphviz-frame'
|
||||
import type { CodeProps } from '../../replace-components/code-block-component-replacer'
|
||||
|
||||
jest.mock('../graphviz/graphviz-frame')
|
||||
|
||||
describe('PlantUML markdown extensions', () => {
|
||||
beforeAll(async () => {
|
||||
jest.spyOn(GraphvizFrameModule, 'GraphvizFrame').mockImplementation((({ code }) => {
|
||||
|
|
|
@ -12,6 +12,8 @@ import * as HighlightedCodeModule from './highlighted-code'
|
|||
import { mockI18n } from '../../test-utils/mock-i18n'
|
||||
import { HighlightedCodeMarkdownExtension } from './highlighted-code-markdown-extension'
|
||||
|
||||
jest.mock('./highlighted-code')
|
||||
|
||||
describe('Highlighted code markdown extension', () => {
|
||||
describe('renders', () => {
|
||||
beforeAll(async () => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Legacy shortcodes markdown extension renders correctly 1`] = `
|
||||
exports[`Legacy shortcodes markdown extension transforms a pdf short code into an URL 1`] = `
|
||||
<div>
|
||||
<p>
|
||||
<a
|
||||
|
@ -8,17 +8,29 @@ exports[`Legacy shortcodes markdown extension renders correctly 1`] = `
|
|||
>
|
||||
https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
|
||||
</a>
|
||||
<br />
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Legacy shortcodes markdown extension transforms a slideshare short code into an URL 1`] = `
|
||||
<div>
|
||||
<p>
|
||||
<a
|
||||
href="https://www.slideshare.net/example/123456789"
|
||||
>
|
||||
https://www.slideshare.net/example/123456789
|
||||
</a>
|
||||
<br />
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Legacy shortcodes markdown extension transforms a speakerdeck short code into an URL 1`] = `
|
||||
<div>
|
||||
<p>
|
||||
<a
|
||||
href="https://speakerdeck.com/example/123456789"
|
||||
>
|
||||
|
|
|
@ -3,41 +3,37 @@
|
|||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import * as replaceLegacyPdfShortCodeModule from './replace-legacy-pdf-short-code'
|
||||
import * as replaceLegacySlideshareShortCodeModule from './replace-legacy-slideshare-short-code'
|
||||
import * as replaceLegacySpeakerdeckShortCodeModule from './replace-legacy-speakerdeck-short-code'
|
||||
import { render } from '@testing-library/react'
|
||||
import { TestMarkdownRenderer } from '../../test-utils/test-markdown-renderer'
|
||||
import React from 'react'
|
||||
import { LegacyShortcodesMarkdownExtension } from './legacy-shortcodes-markdown-extension'
|
||||
import MarkdownIt from 'markdown-it'
|
||||
|
||||
describe('Legacy shortcodes markdown extension', () => {
|
||||
const replaceLegacyPdfShortCodeMarkdownItExtensionMock = jest.spyOn(
|
||||
replaceLegacyPdfShortCodeModule,
|
||||
'legacyPdfShortCode'
|
||||
)
|
||||
const replaceLegacySlideshareShortCodeMarkdownItExtensionMock = jest.spyOn(
|
||||
replaceLegacySlideshareShortCodeModule,
|
||||
'legacySlideshareShortCode'
|
||||
)
|
||||
const replaceLegacySpeakerdeckShortCodeMarkdownItExtensionMock = jest.spyOn(
|
||||
replaceLegacySpeakerdeckShortCodeModule,
|
||||
'legacySpeakerdeckShortCode'
|
||||
)
|
||||
|
||||
it('renders correctly', () => {
|
||||
it('transforms a pdf short code into an URL', () => {
|
||||
const view = render(
|
||||
<TestMarkdownRenderer
|
||||
extensions={[new LegacyShortcodesMarkdownExtension()]}
|
||||
content={
|
||||
'{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}\n{%slideshare example/123456789 %}\n{%speakerdeck example/123456789 %}'
|
||||
}
|
||||
content={'{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}'}
|
||||
/>
|
||||
)
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
it('transforms a slideshare short code into an URL', () => {
|
||||
const view = render(
|
||||
<TestMarkdownRenderer
|
||||
extensions={[new LegacyShortcodesMarkdownExtension()]}
|
||||
content={'{%slideshare example/123456789 %}'}
|
||||
/>
|
||||
)
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
it('transforms a speakerdeck short code into an URL', () => {
|
||||
const view = render(
|
||||
<TestMarkdownRenderer
|
||||
extensions={[new LegacyShortcodesMarkdownExtension()]}
|
||||
content={'{%speakerdeck example/123456789 %}'}
|
||||
/>
|
||||
)
|
||||
expect(replaceLegacyPdfShortCodeMarkdownItExtensionMock).toHaveBeenCalledWith(expect.any(MarkdownIt))
|
||||
expect(replaceLegacySlideshareShortCodeMarkdownItExtensionMock).toHaveBeenCalledWith(expect.any(MarkdownIt))
|
||||
expect(replaceLegacySpeakerdeckShortCodeMarkdownItExtensionMock).toHaveBeenCalledWith(expect.any(MarkdownIt))
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
|
|
|
@ -13,6 +13,8 @@ import * as reduxModule from '../../../../redux'
|
|||
import { Mock } from 'ts-mockery'
|
||||
import type { ApplicationState } from '../../../../redux/application-state'
|
||||
|
||||
jest.mock('../../../../redux')
|
||||
|
||||
describe('PlantUML markdown extensions', () => {
|
||||
beforeAll(async () => {
|
||||
await mockI18n()
|
||||
|
|
|
@ -12,6 +12,8 @@ import { VegaLiteMarkdownExtension } from './vega-lite-markdown-extension'
|
|||
import * as VegaLiteChartModule from '../vega-lite/vega-lite-chart'
|
||||
import type { CodeProps } from '../../replace-components/code-block-component-replacer'
|
||||
|
||||
jest.mock('../vega-lite/vega-lite-chart')
|
||||
|
||||
describe('Vega-Lite markdown extensions', () => {
|
||||
beforeAll(async () => {
|
||||
jest.spyOn(VegaLiteChartModule, 'VegaLiteChart').mockImplementation((({ code }) => {
|
||||
|
|
|
@ -9,6 +9,8 @@ import React from 'react'
|
|||
import type { ClickShieldProps } from '../../replace-components/click-shield/click-shield'
|
||||
import * as ClickShieldModule from '../../replace-components/click-shield/click-shield'
|
||||
|
||||
jest.mock('../../replace-components/click-shield/click-shield')
|
||||
|
||||
describe('VimeoFrame', () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(ClickShieldModule, 'ClickShield').mockImplementation((({ children }) => {
|
||||
|
|
|
@ -9,6 +9,8 @@ import React from 'react'
|
|||
import type { ClickShieldProps } from '../../replace-components/click-shield/click-shield'
|
||||
import * as ClickShieldModule from '../../replace-components/click-shield/click-shield'
|
||||
|
||||
jest.mock('../../replace-components/click-shield/click-shield')
|
||||
|
||||
describe('YoutubeFrame', () => {
|
||||
beforeEach(() => {
|
||||
jest.spyOn(ClickShieldModule, 'ClickShield').mockImplementation((({ children }) => {
|
||||
|
|
|
@ -11,20 +11,10 @@ import * as YouTubeFrameModule from './youtube-frame'
|
|||
import React from 'react'
|
||||
import type { IdProps } from '../../replace-components/custom-tag-with-id-component-replacer'
|
||||
import { mockI18n } from '../../test-utils/mock-i18n'
|
||||
import MarkdownIt from 'markdown-it'
|
||||
import * as replaceLegacyYoutubeShortCodeMarkdownItPluginModule from './replace-legacy-youtube-short-code'
|
||||
import * as replaceYouTubeLinkMarkdownItPluginModule from './replace-youtube-link'
|
||||
|
||||
jest.mock('./youtube-frame')
|
||||
|
||||
describe('youtube markdown extension', () => {
|
||||
const replaceYouTubeLinkMarkdownItPluginSpy = jest.spyOn(
|
||||
replaceYouTubeLinkMarkdownItPluginModule,
|
||||
'replaceYouTubeLinkMarkdownItPlugin'
|
||||
)
|
||||
const replaceLegacyYoutubeShortCodeMarkdownItPluginSpy = jest.spyOn(
|
||||
replaceLegacyYoutubeShortCodeMarkdownItPluginModule,
|
||||
'replaceLegacyYoutubeShortCodeMarkdownItPlugin'
|
||||
)
|
||||
|
||||
beforeAll(async () => {
|
||||
jest
|
||||
.spyOn(YouTubeFrameModule, 'YouTubeFrame')
|
||||
|
@ -46,8 +36,6 @@ describe('youtube markdown extension', () => {
|
|||
content={'https://www.youtube.com/watch?v=XDnhKh5V5XQ'}
|
||||
/>
|
||||
)
|
||||
expect(replaceYouTubeLinkMarkdownItPluginSpy).toHaveBeenCalledWith(expect.any(MarkdownIt))
|
||||
expect(replaceLegacyYoutubeShortCodeMarkdownItPluginSpy).toHaveBeenCalledWith(expect.any(MarkdownIt))
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
|
||||
|
@ -55,8 +43,6 @@ describe('youtube markdown extension', () => {
|
|||
const view = render(
|
||||
<TestMarkdownRenderer extensions={[new YoutubeMarkdownExtension()]} content={'{%youtube XDnhKh5V5XQ %}'} />
|
||||
)
|
||||
expect(replaceYouTubeLinkMarkdownItPluginSpy).toHaveBeenCalledWith(expect.any(MarkdownIt))
|
||||
expect(replaceLegacyYoutubeShortCodeMarkdownItPluginSpy).toHaveBeenCalledWith(expect.any(MarkdownIt))
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
|
||||
|
@ -64,8 +50,6 @@ describe('youtube markdown extension', () => {
|
|||
const view = render(
|
||||
<TestMarkdownRenderer extensions={[new YoutubeMarkdownExtension()]} content={'{%youtube a %}'} />
|
||||
)
|
||||
expect(replaceYouTubeLinkMarkdownItPluginSpy).toHaveBeenCalledWith(expect.any(MarkdownIt))
|
||||
expect(replaceLegacyYoutubeShortCodeMarkdownItPluginSpy).toHaveBeenCalledWith(expect.any(MarkdownIt))
|
||||
expect(view.container).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue