Skip to content

Commit

Permalink
refactor: omnichannel unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Schoeler authored and Martin Schoeler committed Oct 31, 2024
1 parent e72ade5 commit 346a0f0
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions apps/meteor/tests/e2e/omnichannel/omnichannel-units.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.btnSave.click();
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();

await test.step('expect unit to have been created', async () => {
await poOmnichannelUnits.search(unitName);
await expect(poOmnichannelUnits.findRowByName(unitName)).toBeVisible();
});
await poOmnichannelUnits.search(unitName);
await expect(poOmnichannelUnits.findRowByName(unitName)).toBeVisible();
});

await test.step('expect to delete unit', async () => {
Expand Down Expand Up @@ -115,9 +113,6 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.inputName.fill(editedUnitName);
await poOmnichannelUnits.btnSave.click();
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();
});

await test.step('expect unit to have been edited', async () => {
await expect(poOmnichannelUnits.inputSearch).toBeVisible();
await poOmnichannelUnits.search(editedUnitName);
await expect(poOmnichannelUnits.findRowByName(editedUnitName)).toBeVisible();
Expand All @@ -128,9 +123,7 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.selectMonitor('user3');
await poOmnichannelUnits.btnSave.click();
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();
});

await test.step('expect unit to have been edited with 2 monitors', async () => {
await poOmnichannelUnits.search(editedUnitName);
await poOmnichannelUnits.findRowByName(editedUnitName).click();

Expand Down Expand Up @@ -163,6 +156,7 @@ test.describe('OC - Manage Units', () => {
});

await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();
await expect(poOmnichannelUnits.findRowByName(editedUnitName)).not.toBeVisible();
});
});

Expand All @@ -187,9 +181,7 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.selectDepartment({ name: department2.data.name, _id: department2.data._id });
await poOmnichannelUnits.btnSave.click();
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();
});

await test.step('expect department to be in the chosen departments list and have title', async () => {
await poOmnichannelUnits.search(unit.name);
await poOmnichannelUnits.findRowByName(unit.name).click();
await expect(poOmnichannelUnits.contextualBar).toBeVisible();
Expand All @@ -207,9 +199,7 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.selectDepartment({ name: department2.data.name, _id: department2.data._id });
await poOmnichannelUnits.btnSave.click();
await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();
});

await test.step('expect department to not be in the chosen departments list', async () => {
await poOmnichannelUnits.search(unit.name);
await poOmnichannelUnits.findRowByName(unit.name).click();
await expect(poOmnichannelUnits.contextualBar).toBeVisible();
Expand All @@ -228,6 +218,7 @@ test.describe('OC - Manage Units', () => {
});

await expect(poOmnichannelUnits.contextualBar).not.toBeVisible();
await expect(poOmnichannelUnits.findRowByName(unit.name)).not.toBeVisible();
});
});
});

0 comments on commit 346a0f0

Please sign in to comment.