Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman committed Feb 4, 2025
1 parent ed73835 commit 0c7686f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions apps/meteor/tests/end-to-end/api/livechat/24-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,29 @@ import { IS_EE } from '../../../e2e/config/constants';
const roomInfo = await getLivechatRoomInfo(room._id);
expect(roomInfo.servedBy).to.be.undefined;
});
it('should not route to an idle user', async () => {
await setUserStatus(testUser.credentials, UserStatus.AWAY);
await setUserAway(testUser.credentials);
await setUserStatus(testUser3.credentials, UserStatus.AWAY);
await setUserAway(testUser3.credentials);
// Agent is available but should be ignored
await switchLivechatStatus('available', testUser.credentials);

const visitor = await createVisitor(testDepartment._id);
const room = await createLivechatRoom(visitor.token);

const roomInfo = await getLivechatRoomInfo(room._id);
expect(roomInfo.servedBy).to.be.undefined;
});
it('should route to an idle user', async () => {
await updateSetting('Livechat_enabled_when_agent_idle', true);

const visitor = await createVisitor(testDepartment._id);
const room = await createLivechatRoom(visitor.token);

const roomInfo = await getLivechatRoomInfo(room._id);
expect(roomInfo.servedBy).to.be.an('object');
});
it('should route to another available agent if contact manager is unavailable and Omnichannel_contact_manager_routing is enabled', async () => {
await makeAgentAvailable(testUser.credentials);
const visitor = await createVisitor(testDepartment._id, faker.person.fullName(), visitorEmail);
Expand Down

0 comments on commit 0c7686f

Please sign in to comment.