Files
chatwoot/app/javascript/dashboard/store/modules/specs/account/getters.spec.js
Pranav 9de8c27368 feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722)
Due to the pattern `**/specs/*.spec.js` defined in CircleCI, none of the
frontend spec in the folders such as
`specs/<domain-name>/getters.spec.js` were not executed in Circle CI.

This PR fixes the issue, along with the following changes: 
- Use vitest instead of jest
- Remove jest dependancies
- Update tests to work with vitest

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2024-07-10 08:32:16 -07:00

50 lines
1000 B
JavaScript

import { getters } from '../../accounts';
const accountData = {
id: 1,
name: 'Company one',
locale: 'en',
features: {
auto_resolve_conversations: true,
agent_management: false,
},
};
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,
});
});
it('isFeatureEnabledonAccount', () => {
const state = {
records: [accountData],
};
expect(
getters.isFeatureEnabledonAccount(
state,
null,
null
)(1, 'auto_resolve_conversations')
).toEqual(true);
});
});