feat: Save UI state in the database (#1635)

feat: Save UI state in the database
This commit is contained in:
Pranav Raj S
2021-01-10 19:25:33 +05:30
committed by GitHub
parent 37d8e1c9a0
commit 160a6fc6cf
13 changed files with 129 additions and 15 deletions

View File

@@ -0,0 +1,21 @@
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',
});
});
});
});