signal-desktop/ts/test-both/state/ducks/globalModals_test.ts

28 lines
716 B
TypeScript
Raw Normal View History

2021-05-28 16:15:17 +00:00
// 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('toggleChatColorEditor', () => {
const { toggleChatColorEditor } = actions;
it('toggles isChatColorEditorVisible', () => {
const state = getEmptyState();
const nextState = reducer(state, toggleChatColorEditor());
assert.isTrue(nextState.isChatColorEditorVisible);
const nextNextState = reducer(nextState, toggleChatColorEditor());
assert.isFalse(nextNextState.isChatColorEditorVisible);
});
});
});