Skip to content

Commit

Permalink
fix: restore tooltips to units Multiselect (#33174)
Browse files Browse the repository at this point in the history
Co-authored-by: Douglas Fabris <[email protected]>
  • Loading branch information
MartinSchoeler and dougfabris authored Aug 29, 2024
1 parent 6a27d7b commit bb7d721
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-rings-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Restored tooltips to the unit edit department field selected options
2 changes: 1 addition & 1 deletion apps/meteor/client/omnichannel/units/UnitEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ const UnitEdit = ({ unitData, unitMonitors, unitDepartments }: UnitEditProps) =>
value={value}
onChange={onChange}
onBlur={onBlur}
withTitle={false}
withTitle
filter={departmentsFilter}
setFilter={setDepartmentsFilter}
options={departmentsOptions}
Expand Down
7 changes: 5 additions & 2 deletions apps/meteor/tests/e2e/omnichannel/omnichannel-units.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,14 @@ test.describe('OC - Manage Units', () => {
await poOmnichannelUnits.btnSave.click();
});

await test.step('expect department to be in the chosen departments list', async () => {
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();
await expect(page.getByRole('option', { name: department2.data.name })).toBeVisible();
await expect(poOmnichannelUnits.selectOptionChip(department2.data.name)).toBeVisible();
await poOmnichannelUnits.selectOptionChip(department2.data.name).hover();

await expect(page.getByRole('tooltip', { name: department2.data.name })).toBeVisible();
await poOmnichannelUnits.btnContextualbarClose.click();
});

Expand Down
4 changes: 4 additions & 0 deletions apps/meteor/tests/e2e/page-objects/omnichannel-units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export class OmnichannelUnits extends OmnichannelAdministration {
return this.page.locator(`[role=option][value="${name}"]`);
}

public selectOptionChip(name: string) {
return this.page.getByRole('option', { name });
}

async selectDepartment({ name, _id }: { name: string; _id: string }) {
await this.inputDepartments.click();
await this.inputDepartments.fill(name);
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-client/src/components/TooltipComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const TooltipComponent = ({ title, anchor }: TooltipComponentProps): Reac

return (
<PositionAnimated anchor={ref} placement='top-middle' margin={8} visible={AnimatedVisibility.UNHIDING}>
<Tooltip>{title}</Tooltip>
<Tooltip role='tooltip'>{title}</Tooltip>
</PositionAnimated>
);
};

0 comments on commit bb7d721

Please sign in to comment.