Skip to content

Commit 58e9f9e

Browse files
authored
test: Fix flaky livechat tests (RocketChat#37483)
1 parent c351232 commit 58e9f9e

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

apps/meteor/tests/end-to-end/api/livechat/00-rooms.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,10 @@ describe('LIVECHAT - rooms', () => {
484484
});
485485

486486
after(async () => {
487-
await updateSetting('Livechat_Routing_Method', 'Auto_Selection');
488-
await updateSetting('Livechat_allow_manual_on_hold', false);
489487
await closeOmnichannelRoom(room._id);
490488
await closeOmnichannelRoom(room2._id);
489+
await updateSetting('Livechat_allow_manual_on_hold', false);
490+
await updateSetting('Livechat_Routing_Method', 'Auto_Selection');
491491
});
492492

493493
it('should not return on hold rooms along with queued rooms when `queued` is true and `onHold` is true', async () => {

apps/meteor/tests/end-to-end/api/livechat/12-priorites.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
createLivechatRoom,
2020
bulkCreateLivechatRooms,
2121
startANewLivechatRoomAndTakeIt,
22+
makeAgentAvailable,
2223
} from '../../../data/livechat/rooms';
2324
import {
2425
addPermissions,
@@ -294,6 +295,10 @@ import { generateRandomSLAData } from '../../../e2e/utils/omnichannel/sla';
294295
});
295296

296297
describe('livechat/inquiry.setSLA', () => {
298+
before(async () => {
299+
await createAgent();
300+
await makeAgentAvailable();
301+
});
297302
it('should return an "unauthorized error" when the user does not have the necessary permission', async () => {
298303
await removePermissions(['manage-livechat-sla', 'view-l-room', 'manage-livechat-priorities']);
299304
const response = await request
@@ -349,7 +354,6 @@ import { generateRandomSLAData } from '../../../e2e/utils/omnichannel/sla';
349354
it('should fail if sla is not valid', async () => {
350355
const visitor = await createVisitor();
351356
const room = await createLivechatRoom(visitor.token);
352-
await createAgent();
353357

354358
const response = await request
355359
.put(api('livechat/inquiry.setSLA'))

0 commit comments

Comments
 (0)