Skip to content

Commit b89de61

Browse files
authored
Improve invite dialog ui - Part 1 (#30764)
* refactor: move `humanize` in shared components * feat: add `RichItem` component * feat: add `RichList` component * refactor: use `RichList` and `RichItem` in `InviteDialog` * fix: exclude `InviteDialog` button to css override * test: update selector in invite dialog * test(e2e): update crypto test to use correct selector * test(e2e): update invite dialog * test: add test for `humanize.ts` * fix: add space between the list and the input when the list is scrollable * test(e2e): update screenshots
1 parent 3c6d341 commit b89de61

30 files changed

+848
-159
lines changed

playwright/e2e/crypto/crypto.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const startDMWithBob = async (page: Page, bob: Bot) => {
2424
await page.getByRole("navigation", { name: "Room list" }).getByRole("button", { name: "Add" }).click();
2525
await page.getByRole("menuitem", { name: "Start chat" }).click();
2626
await page.getByTestId("invite-dialog-input").fill(bob.credentials.userId);
27-
await page.locator(".mx_InviteDialog_tile_nameStack_name").getByText("Bob").click();
27+
await page.getByRole("option", { name: bob.credentials.displayName }).click();
2828
await expect(
2929
page.locator(".mx_InviteDialog_userTile_pill .mx_InviteDialog_userTile_name").getByText("Bob"),
3030
).toBeVisible();

playwright/e2e/invite/invite-dialog.spec.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ test.describe("Invite dialog", function () {
5050
await expect(other.locator(".mx_InviteDialog_identityServer")).toBeVisible();
5151

5252
// Assert that the bot id is rendered properly
53-
await expect(
54-
other.locator(".mx_InviteDialog_tile_nameStack_userId").getByText(bot.credentials.userId),
55-
).toBeVisible();
53+
await expect(other.getByRole("option", { name: botName }).getByText(bot.credentials.userId)).toBeVisible();
5654

57-
await other.locator(".mx_InviteDialog_tile_nameStack_name").getByText(botName).click();
55+
await other.getByRole("option", { name: botName }).click();
5856

5957
await expect(
6058
other.locator(".mx_InviteDialog_userTile_pill .mx_InviteDialog_userTile_name").getByText(botName),
@@ -94,10 +92,8 @@ test.describe("Invite dialog", function () {
9492

9593
await other.getByTestId("invite-dialog-input").fill(bot.credentials.userId);
9694

97-
await expect(
98-
other.locator(".mx_InviteDialog_tile_nameStack").getByText(bot.credentials.userId),
99-
).toBeVisible();
100-
await other.locator(".mx_InviteDialog_tile_nameStack").getByText(botName).click();
95+
await expect(other.getByRole("option", { name: botName }).getByText(bot.credentials.userId)).toBeVisible();
96+
await other.getByRole("option", { name: botName }).click();
10197

10298
await expect(
10399
other.locator(".mx_InviteDialog_userTile_pill .mx_InviteDialog_userTile_name").getByText(botName),
10.6 KB
Loading
10.6 KB
Loading
11 KB
Loading
16.7 KB
Loading
9 KB
Loading
15.1 KB
Loading
7.41 KB
Loading
-3.17 KB
Loading

0 commit comments

Comments
 (0)