mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
- UI will show the breach in the conversation list. - UI will show the breach in the conversation header. Fixes: https://linear.app/chatwoot/issue/CW-3146/update-the-ui-to-show-the-breach-in-the-conversation-list Fixes: https://linear.app/chatwoot/issue/CW-3144/ui-update-to-show-the-breachgoing-to-breach
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
import types from '../../../mutation-types';
|
|
import { mutations } from '../../sla';
|
|
import SLAs from './fixtures';
|
|
|
|
describe('#mutations', () => {
|
|
describe('#SET_SLA_UI_FLAG', () => {
|
|
it('set sla ui flags', () => {
|
|
const state = { uiFlags: {} };
|
|
mutations[types.SET_SLA_UI_FLAG](state, { isFetching: true });
|
|
expect(state.uiFlags).toEqual({ isFetching: true });
|
|
});
|
|
});
|
|
describe('#SET_SLA', () => {
|
|
it('set sla records', () => {
|
|
const state = { records: [] };
|
|
mutations[types.SET_SLA](state, SLAs);
|
|
expect(state.records).toEqual(SLAs);
|
|
});
|
|
});
|
|
describe('#ADD_SLA', () => {
|
|
it('push newly created sla to the store', () => {
|
|
const state = { records: [SLAs[0]] };
|
|
mutations[types.ADD_SLA](state, SLAs[1]);
|
|
expect(state.records).toEqual([SLAs[0], SLAs[1]]);
|
|
});
|
|
});
|
|
describe('#DELETE_SLA', () => {
|
|
it('delete sla record', () => {
|
|
const state = { records: [SLAs[0]] };
|
|
mutations[types.DELETE_SLA](state, 1);
|
|
expect(state.records).toEqual([]);
|
|
});
|
|
});
|
|
});
|