607fc25723
Copy update for agent status
26 lines
797 B
JavaScript
26 lines
797 B
JavaScript
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 are 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');
|
|
});
|
|
});
|