Files
leadchat/app/javascript/dashboard/store/modules/specs/conversationWatchers/mutations.spec.js
Sojan Jose ca1adb9960 feat: conversation participants (#4145)
Fixes #241
Fixes: chatwoot/product#648

Co-authored-by: Aswin Dev P.S <aswindevps@gmail.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-02-16 13:35:06 +05:30

38 lines
897 B
JavaScript

import types from '../../../mutation-types';
import { mutations } from '../../conversationWatchers';
describe('#mutations', () => {
describe('#SET_CONVERSATION_PARTICIPANTS', () => {
it('sets an individual record', () => {
let state = {
records: {},
};
mutations[types.SET_CONVERSATION_PARTICIPANTS](state, {
data: [],
conversationId: 1,
});
expect(state.records).toEqual({ 1: [] });
});
});
describe('#SET_CONVERSATION_PARTICIPANTS_UI_FLAG', () => {
it('set ui flags', () => {
let state = {
uiFlags: {
isFetching: true,
isUpdating: false,
},
};
mutations[types.SET_CONVERSATION_PARTICIPANTS_UI_FLAG](state, {
isFetching: false,
});
expect(state.uiFlags).toEqual({
isFetching: false,
isUpdating: false,
});
});
});
});