feat: Display Account context in the UI (#4069)

This commit is contained in:
Pranav Raj S
2022-02-25 16:36:36 +05:30
committed by GitHub
parent 2c8a3ef3b2
commit cc74bebc0f
13 changed files with 138 additions and 6 deletions

View File

@@ -53,4 +53,60 @@ describe('#getters', () => {
).toEqual('');
});
});
describe('#getCurrentAccount', () => {
it('returns correct values', () => {
expect(
getters.getCurrentAccount({
currentUser: {},
currentAccountId: 1,
})
).toEqual({});
expect(
getters.getCurrentAccount({
currentUser: {
accounts: [
{
name: 'Chatwoot',
id: 1,
},
],
},
currentAccountId: 1,
})
).toEqual({
name: 'Chatwoot',
id: 1,
});
});
});
describe('#getUserAccounts', () => {
it('returns correct values', () => {
expect(
getters.getUserAccounts({
currentUser: {},
})
).toEqual([]);
expect(
getters.getUserAccounts({
currentUser: {
accounts: [
{
name: 'Chatwoot',
id: 1,
},
],
},
})
).toEqual([
{
name: 'Chatwoot',
id: 1,
},
]);
});
});
});