Chatwoot/app/javascript/dashboard/store/modules/specs/account/getters.spec.js

33 lines
651 B
JavaScript
Raw Normal View History

import { getters } from '../../accounts';
const accountData = {
id: 1,
name: 'Company one',
locale: 'en',
};
describe('#getters', () => {
it('getAccount', () => {
const state = {
records: [accountData],
};
expect(getters.getAccount(state)(1)).toEqual(accountData);
});
it('getUIFlags', () => {
const state = {
uiFlags: {
isFetching: true,
isCreating: false,
isUpdating: false,
isDeleting: false,
},
};
expect(getters.getUIFlags(state)).toEqual({
isFetching: true,
isCreating: false,
isUpdating: false,
isDeleting: false,
});
});
});