Files
chatwoot/app/javascript/dashboard/store/modules/specs/bulkActions/mutations.spec.js
Sivin Varghese 5138a0ad32 feat: Adds support for all snooze option in bulk actions (#9361)
* feat: Add support for bulk snooze until

* feat: Adds support for all snooze option in bulk actions

* chore: Adds comment

* chore: Review fixes

* chore: Minor fix

* chore: Minor fix

* chore: Review fixes

* chore: yarn changes

* fix: terminal waring

* chore: Adds spec

* Update conversationHotKeys.js

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-05-09 19:27:31 +05:30

34 lines
1.3 KiB
JavaScript

import types from '../../../mutation-types';
import { mutations } from '../../bulkActions';
describe('#mutations', () => {
describe('#toggleUiFlag', () => {
it('set update flags', () => {
const state = { uiFlags: { isUpdating: false } };
mutations[types.SET_BULK_ACTIONS_FLAG](state, { isUpdating: true });
expect(state.uiFlags.isUpdating).toEqual(true);
});
});
describe('#setSelectedConversationIds', () => {
it('set selected conversation ids', () => {
const state = { selectedConversationIds: [] };
mutations[types.SET_SELECTED_CONVERSATION_IDS](state, [1, 2, 3]);
expect(state.selectedConversationIds).toEqual([1, 2, 3]);
});
});
describe('#removeSelectedConversationIds', () => {
it('remove selected conversation ids', () => {
const state = { selectedConversationIds: [1, 2, 3] };
mutations[types.REMOVE_SELECTED_CONVERSATION_IDS](state, 1);
expect(state.selectedConversationIds).toEqual([2, 3]);
});
});
describe('#clearSelectedConversationIds', () => {
it('clear selected conversation ids', () => {
const state = { selectedConversationIds: [1, 2, 3] };
mutations[types.CLEAR_SELECTED_CONVERSATION_IDS](state);
expect(state.selectedConversationIds).toEqual([]);
});
});
});