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

32 lines
756 B
JavaScript
Raw Normal View History

2022-10-12 00:23:57 +00:00
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,
});
});
});