Chatwoot/app/javascript/dashboard/store/modules/specs/agentBots/getters.spec.js
2022-10-11 17:23:57 -07:00

31 lines
756 B
JavaScript

import { getters } from '../../agentBots';
import { agentBotRecords } from './fixtures';
describe('#getters', () => {
it('getBots', () => {
const state = { records: agentBotRecords };
expect(getters.getBots(state)).toEqual(agentBotRecords);
});
it('getBot', () => {
const state = { records: agentBotRecords };
expect(getters.getBot(state)(11)).toEqual(agentBotRecords[0]);
});
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,
});
});
});