Chatwoot/app/javascript/dashboard/store/modules/specs/auth/mutations.spec.js
Pranav Raj S 160a6fc6cf
feat: Save UI state in the database (#1635)
feat: Save UI state in the database
2021-01-10 19:25:33 +05:30

21 lines
620 B
JavaScript

import types from '../../../mutation-types';
import { mutations } from '../../auth';
describe('#mutations', () => {
describe('#SET_CURRENT_USER_UI_SETTINGS', () => {
it('set ui flags', () => {
const state = {
currentUser: {
ui_settings: { is_contact_sidebar_open: true, icon_type: 'emoji' },
},
};
mutations[types.SET_CURRENT_USER_UI_SETTINGS](state, {
uiSettings: { is_contact_sidebar_open: false },
});
expect(state.currentUser.ui_settings).toEqual({
is_contact_sidebar_open: false,
icon_type: 'emoji',
});
});
});
});