chore: Add AgentBot API module (#5599)

This commit is contained in:
Pranav Raj S
2022-10-12 11:23:57 +11:00
committed by GitHub
parent 7419e413f4
commit 5f4b6f2ce4
9 changed files with 321 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
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,
});
});
});