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

33 lines
765 B
JavaScript
Raw Normal View History

2022-09-23 11:16:49 +00:00
import { getters } from '../../macros';
import macros from './fixtures';
describe('#getters', () => {
it('getMacros', () => {
const state = { records: macros };
expect(getters.getMacros(state)).toEqual(macros);
});
it('getMacro', () => {
const state = { records: macros };
expect(getters.getMacro(state)(22)).toEqual(macros[0]);
});
it('getUIFlags', () => {
const state = {
uiFlags: {
isFetching: true,
isCreating: false,
isUpdating: false,
isDeleting: false,
isExecuting: false,
},
};
expect(getters.getUIFlags(state)).toEqual({
isFetching: true,
isCreating: false,
isUpdating: false,
isDeleting: false,
isExecuting: false,
});
});
});