Skip to content

Commit

Permalink
chore: allow manual on hold
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandernsilva committed Dec 4, 2023
1 parent 7c86da6 commit 4dc7b96
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ test.describe('OC - Monitor Role', () => {
let unit: Awaited<ReturnType<typeof createOrUpdateUnit>>;
let poOmnichannel: HomeOmnichannel;

// Allow manual on hold
test.beforeAll(async ({ api }) => {
const responses = await Promise.all([
api.post('/settings/Livechat_allow_manual_on_hold', { value: true }),
api.post('/settings/Livechat_allow_manual_on_hold_upon_agent_engagement_only', { value: false }),
]);
responses.forEach((res) => expect(res.status()).toBe(200));
});

// Create agents
test.beforeAll(async ({ api }) => {
agents = await Promise.all([createAgent(api, 'user1'), createAgent(api, 'user2'), createAgent(api, MONITOR)]);
Expand Down Expand Up @@ -86,13 +95,16 @@ test.describe('OC - Monitor Role', () => {
});

// Delete all created data
test.afterAll(async () => {
test.afterAll(async ({ api }) => {
await Promise.all([
...agents.map((agent) => agent.delete()),
...departments.map((department) => department.delete()),
...conversations.map((conversation) => conversation.delete()),
monitor.delete(),
unit.delete(),
// Reset setting
api.post('/settings/Livechat_allow_manual_on_hold', { value: false }),
api.post('/settings/Livechat_allow_manual_on_hold_upon_agent_engagement_only', { value: true }),
]);
});

Expand Down

0 comments on commit 4dc7b96

Please sign in to comment.