diff --git a/apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts b/apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts index 53aaa7021a71..c0e32f839cb9 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts +++ b/apps/meteor/tests/end-to-end/api/livechat/19-business-hours.ts @@ -838,17 +838,22 @@ describe('LIVECHAT - business hours', function () { expect(latestAgent.statusLivechat).to.be.undefined; }); - it('should verify a newly created agent to be assigned to the default business hour', async () => { - const agent = await createUser({ roles: ['user', 'livechat-agent'] }); - const agentCredentials = await login(agent.username, password); - - const latestAgent: ILivechatAgent = await getMe(agentCredentials as any); - expect(latestAgent).to.be.an('object'); - expect(latestAgent.openBusinessHours).to.be.an('array').of.length(1); - expect(latestAgent?.openBusinessHours?.[0]).to.be.equal(defaultBH._id); - - // cleanup - await deleteUser(agent); + describe('Special Case - Agent created, BH already enabled', () => { + let agent: ILivechatAgent; + let agentCredentials: IUserCredentialsHeader; + before(async () => { + agent = await createUser({ roles: ['user', 'livechat-agent'] }); + agentCredentials = await login(agent.username, password); + }); + after(async () => { + await deleteUser(agent); + }); + it('should verify a newly created agent to be assigned to the default business hour', async () => { + const latestAgent: ILivechatAgent = await getMe(agentCredentials as any); + expect(latestAgent).to.be.an('object'); + expect(latestAgent.openBusinessHours).to.be.an('array').of.length(1); + expect(latestAgent?.openBusinessHours?.[0]).to.be.equal(defaultBH._id); + }); }); after(async () => {