Skip to content

Commit

Permalink
conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman committed May 9, 2024
1 parent e0ba4e6 commit ba6312c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/ee/client/omnichannel/units/UnitEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ const UnitEdit = ({ unitData, unitMonitors, unitDepartments }: UnitEditProps) =>

const currUnitMonitors = useMemo(
() =>
unitMonitors?.map(({ _id, username }) => ({
value: _id,
unitMonitors?.map(({ monitorId, username }) => ({
value: monitorId,
label: username,
})) || [],
[unitMonitors],
Expand Down
27 changes: 25 additions & 2 deletions apps/meteor/tests/e2e/omnichannel/omnichannel-units.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ test.describe('OC - Manage Units', () => {

let monitor: Awaited<ReturnType<typeof createMonitor>>;

let monitor2: Awaited<ReturnType<typeof createMonitor>>;

test.beforeAll(async ({ api }) => {
department = await createDepartment(api);
department2 = await createDepartment(api);
Expand All @@ -35,12 +37,14 @@ test.describe('OC - Manage Units', () => {

test.beforeAll(async ({ api }) => {
monitor = await createMonitor(api, 'user2');
monitor2 = await createMonitor(api, 'user3');
});

test.afterAll(async () => {
await department.delete();
await department2.delete();
await monitor.delete();
await monitor2.delete();
await agent.delete();
});

Expand Down Expand Up @@ -101,8 +105,9 @@ test.describe('OC - Manage Units', () => {
return newUnit;
});

await page.reload();

await page.goto('/omnichannel');
await poOmnichannelUnits.sidenav.linkUnits.click();

await test.step('expect to edit unit', async () => {
await poOmnichannelUnits.search(unit.name);
await poOmnichannelUnits.findRowByName(unit.name).click();
Expand All @@ -117,6 +122,24 @@ test.describe('OC - Manage Units', () => {
await expect(poOmnichannelUnits.findRowByName(editedUnitName)).toBeVisible();
});

await test.step('expect to add another monitor to list', async () => {
await poOmnichannelUnits.findRowByName(editedUnitName).click();
await expect(poOmnichannelUnits.contextualBar).toBeVisible();
await poOmnichannelUnits.selectMonitor('user3');
await poOmnichannelUnits.btnSave.click();
});

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

await expect(poOmnichannelUnits.inputMonitors).toHaveText(/user2/);
await expect(poOmnichannelUnits.inputMonitors).toHaveText(/user3/);
});

await test.step('expect to delete unit', async () => {
await poOmnichannelUnits.findRowByName(editedUnitName).click();
await expect(poOmnichannelUnits.contextualBar).toBeVisible();
Expand Down

0 comments on commit ba6312c

Please sign in to comment.