chore: Sets up store for teams settings page (#1727)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Nithin David Thomas
2021-02-04 13:19:59 +05:30
committed by GitHub
parent c61edff189
commit 6a614a520b
17 changed files with 608 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
import { getters } from '../../teams/getters';
import teamsList from './fixtures';
describe('#getters', () => {
it('getTeams', () => {
const state = {
records: teamsList,
};
expect(getters.getTeams(state)).toEqual([teamsList[1]]);
});
it('getTeam', () => {
const state = {
records: teamsList,
};
expect(getters.getTeam(state)(1)).toEqual({
id: 1,
account_id: 1,
name: 'Test',
description: 'Some team',
});
});
it('getUIFlags', () => {
const state = {
uiFlags: {
isFetching: false,
isCreating: false,
isUpdating: false,
isDeleting: false,
},
};
expect(getters.getUIFlags(state)).toEqual({
isFetching: false,
isCreating: false,
isUpdating: false,
isDeleting: false,
});
});
});