mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
Feature: As an end-user, I should be able to see the list of agents in the widget. (#461)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
committed by
GitHub
parent
33e0bd434b
commit
83b0bb4062
26
app/javascript/widget/helpers/specs/utils.spec.js
Normal file
26
app/javascript/widget/helpers/specs/utils.spec.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { getAvailableAgentsText } from '../utils';
|
||||
|
||||
describe('#getAvailableAgentsText', () => {
|
||||
it('returns the correct text is there is only one online agent', () => {
|
||||
expect(getAvailableAgentsText([{ name: 'Pranav' }])).toEqual(
|
||||
'Pranav is available'
|
||||
);
|
||||
});
|
||||
|
||||
it('returns the correct text is there are two online agents', () => {
|
||||
expect(
|
||||
getAvailableAgentsText([{ name: 'Pranav' }, { name: 'Nithin' }])
|
||||
).toEqual('Pranav and Nithin is available');
|
||||
});
|
||||
|
||||
it('returns the correct text is there are more than two online agents', () => {
|
||||
expect(
|
||||
getAvailableAgentsText([
|
||||
{ name: 'Pranav' },
|
||||
{ name: 'Nithin' },
|
||||
{ name: 'Subin' },
|
||||
{ name: 'Sojan' },
|
||||
])
|
||||
).toEqual('Pranav and 3 others are available');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user