mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
feat: Display Account context in the UI (#4069)
This commit is contained in:
@@ -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,
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user