Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman authored Feb 4, 2025
1 parent b06ca4c commit ed73835
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 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,29 +372,6 @@ 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 Expand Up @@ -436,30 +413,6 @@ import { IS_EE } from '../../../e2e/config/constants';
});
});

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 not route to contact manager if it is online but setting is off', async () => {
const visitor = await createVisitor(testDepartment2._id, faker.person.fullName(), visitorEmail);
const room = await createLivechatRoom(visitor.token);
Expand Down

0 comments on commit ed73835

Please sign in to comment.