From 10abc1ab98c376dc80489db935278314a8d4e59a Mon Sep 17 00:00:00 2001 From: Lucas Pelegrino Date: Thu, 23 Jan 2025 16:58:23 -0300 Subject: [PATCH] refactor: moves setting update to before/after tests --- .../tests/end-to-end/api/livechat/04-dashboards.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/livechat/04-dashboards.ts b/apps/meteor/tests/end-to-end/api/livechat/04-dashboards.ts index 4143b04debe9..5facfbe965a7 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/04-dashboards.ts +++ b/apps/meteor/tests/end-to-end/api/livechat/04-dashboards.ts @@ -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 }); @@ -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;