Skip to content

Commit

Permalink
test: ignore errors on cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Sep 1, 2024
1 parent b50a952 commit ba18fc5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-env mocha */

import { faker } from '@faker-js/faker';
import type { ILivechatDepartment, ILivechatVisitor, IOmnichannelRoom, IUser } from '@rocket.chat/core-typings';
import { expect } from 'chai';
import { after, before, describe, it } from 'mocha';
Expand All @@ -23,7 +24,11 @@ const cleanupRooms = async () => {
body: { rooms },
} = await request.get(api('livechat/rooms')).query({ 'agents[]': item.user._id }).set(credentials);

await Promise.all(rooms.map((room: IOmnichannelRoom) => closeOmnichannelRoom(room._id)));
await Promise.all(
rooms.map((room: IOmnichannelRoom) =>
request.post(api('livechat/room.closeByUser')).set(credentials).send({ rid: room._id, comment: faker.lorem.sentence() }),
),
);
}
};

Expand Down

0 comments on commit ba18fc5

Please sign in to comment.