Skip to content

Commit

Permalink
refactor: moves setting update to before/after tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-a-pelegrino committed Jan 23, 2025
1 parent 6089fee commit 10abc1a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps/meteor/tests/end-to-end/api/livechat/04-dashboards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,9 +933,17 @@ describe('LIVECHAT - dashboards', function () {
agent = await createAnOnlineAgent();
forwardAgent = await createAnOnlineAgent();
botAgent = await createBotAgent();

await updateSetting('Omnichannel_Metrics_Ignore_Automatic_Messages', true);
});

after(async () => Promise.all([deleteUser(agent.user), deleteUser(forwardAgent.user)]));
after(async () =>
Promise.all([
deleteUser(agent.user),
deleteUser(forwardAgent.user),
updateSetting('Omnichannel_Metrics_Ignore_Automatic_Messages', false),
]),
);

it('should return no average response time for an agent if no response has been sent in the period', async () => {
await startANewLivechatRoomAndTakeIt({ agent: agent.credentials });
Expand Down Expand Up @@ -987,8 +995,6 @@ describe('LIVECHAT - dashboards', function () {
});

it("should not consider bot messages in agent's first response time metric if setting is enabled", async () => {
await updateSetting('Omnichannel_Metrics_Ignore_Automatic_Messages', true);

const response = await startANewLivechatRoomAndTakeIt({ agent: botAgent.credentials });

roomId = response.room._id;
Expand Down

0 comments on commit 10abc1a

Please sign in to comment.