Move toolbar functions into redux reducer (#1763)

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-01-26 17:14:28 +01:00 committed by GitHub
parent a6a2251c88
commit b30cc5b390
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
80 changed files with 2481 additions and 2303 deletions

View file

@ -0,0 +1,18 @@
/*
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { initialState } from '../initial-state'
import type { CursorSelection } from '../../editor/types'
import { Mock } from 'ts-mockery'
import { buildStateFromUpdateCursorPosition } from './build-state-from-update-cursor-position'
describe('build state from update cursor position', () => {
it('creates a new state with the given cursor', () => {
const state = { ...initialState }
const selection: CursorSelection = Mock.of<CursorSelection>()
expect(buildStateFromUpdateCursorPosition(state, selection)).toStrictEqual({ ...state, selection })
})
})