mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 02:35:23 -04:00
refactor(common): extract frontmatter code into commons
Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
8bd7fd1be8
commit
8e57188ab5
7 changed files with 14 additions and 8 deletions
2
frontend/src/redux/application-state.d.ts
vendored
2
frontend/src/redux/application-state.d.ts
vendored
|
@ -7,10 +7,10 @@ import type { Config } from '../api/config/types'
|
|||
import type { HistoryEntryWithOrigin } from '../api/history/types'
|
||||
import type { DarkModeConfig } from './dark-mode/types'
|
||||
import type { EditorConfig } from './editor/types'
|
||||
import type { NoteDetails } from './note-details/types/note-details'
|
||||
import type { RealtimeStatus } from './realtime/types'
|
||||
import type { RendererStatus } from './renderer-status/types'
|
||||
import type { OptionalUserState } from './user/types'
|
||||
import type { NoteDetails } from '@hedgedoc/commons'
|
||||
|
||||
export interface ApplicationState {
|
||||
user: OptionalUserState
|
||||
|
|
|
@ -7,9 +7,14 @@ import { initialState } from '../initial-state'
|
|||
import { buildStateFromFirstHeadingUpdate } from './build-state-from-first-heading-update'
|
||||
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
jest.mock('../generate-note-title', () => ({
|
||||
generateNoteTitle: () => 'generated title'
|
||||
}))
|
||||
jest.mock(
|
||||
'@hedgedoc/commons',
|
||||
() =>
|
||||
({
|
||||
...jest.requireActual('@hedgedoc/commons'),
|
||||
generateNoteTitle: () => 'generated title'
|
||||
} as Record<string, unknown>)
|
||||
)
|
||||
|
||||
describe('build state from first heading update', () => {
|
||||
it('generates a new state with the given first heading', () => {
|
||||
|
|
|
@ -7,8 +7,8 @@ import type { Note } from '../../../api/notes/types'
|
|||
import * as buildStateFromUpdatedMarkdownContentModule from '../build-state-from-updated-markdown-content'
|
||||
import { initialSlideOptions } from '../initial-state'
|
||||
import type { NoteDetails } from '../types/note-details'
|
||||
import { NoteTextDirection, NoteType } from '../types/note-details'
|
||||
import { buildStateFromServerDto } from './build-state-from-set-note-data-from-server'
|
||||
import { NoteTextDirection, NoteType } from '@hedgedoc/commons'
|
||||
import { DateTime } from 'luxon'
|
||||
import { Mock } from 'ts-mockery'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue