signal-desktop/ts/test-both/state/ducks/globalModals_test.ts
2021-08-18 13:08:14 -07:00

27 lines
702 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
import {
actions,
getEmptyState,
reducer,
} from '../../../state/ducks/globalModals';
describe('both/state/ducks/globalModals', () => {
describe('toggleProfileEditor', () => {
const { toggleProfileEditor } = actions;
it('toggles isProfileEditorVisible', () => {
const state = getEmptyState();
const nextState = reducer(state, toggleProfileEditor());
assert.isTrue(nextState.isProfileEditorVisible);
const nextNextState = reducer(nextState, toggleProfileEditor());
assert.isFalse(nextNextState.isProfileEditorVisible);
});
});
});