refactor(tests): add test utils for mocking common things

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-09-04 12:09:35 +02:00
parent b3fb1bbf30
commit ad80b444ff
16 changed files with 186 additions and 117 deletions

View file

@ -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
*/
@ -7,7 +7,7 @@ import type { DarkModeConfig, DarkModeConfigAction } from './types'
import { DarkModeConfigActionType, DarkModePreference } from './types'
import type { Reducer } from 'redux'
const initialState: DarkModeConfig = {
export const initialState: DarkModeConfig = {
darkModePreference: DarkModePreference.AUTO
}

View file

@ -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
*/
@ -10,7 +10,7 @@ import { Logger } from '../../utils/logger'
const logger = new Logger('EditorConfig Local Storage')
const initialState: EditorConfig = {
export const initialState: EditorConfig = {
ligatures: true,
syncScroll: true,
smartPaste: true,

View file

@ -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
*/
@ -7,7 +7,7 @@ import type { RealtimeStatus, RealtimeStatusActions } from './types'
import { RealtimeStatusActionType } from './types'
import type { Reducer } from 'redux'
const initialState: RealtimeStatus = {
export const initialState: RealtimeStatus = {
isSynced: false,
isConnected: false,
onlineUsers: [],

View file

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
@ -7,7 +7,7 @@ import type { RendererStatus, RendererStatusActions } from './types'
import { RendererStatusActionType } from './types'
import type { Reducer } from 'redux'
const initialState: RendererStatus = {
export const initialState: RendererStatus = {
rendererReady: false
}