Skip to content

Commit 9cecd52

Browse files
authored
Improve invite dialog ui - Part 2 (#30836)
* feat: add `Pill` component * chore: add `react-merge-refs` lib * feat: add `PillInput` component * feat: use new pills component in invite dialog * test: update invite dialog selector * test(e2e): update test locators * test(e2e): update screenshot
1 parent 3d5749b commit 9cecd52

29 files changed

+520
-151
lines changed

jest.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ const config: Config = {
4141
"recorderWorkletFactory": "<rootDir>/__mocks__/empty.js",
4242
"^fetch-mock$": "<rootDir>/node_modules/fetch-mock",
4343
},
44-
transformIgnorePatterns: ["/node_modules/(?!(mime|matrix-js-sdk|uuid|p-retry|is-network-error)).+$"],
44+
transformIgnorePatterns: [
45+
"/node_modules/(?!(mime|matrix-js-sdk|uuid|p-retry|is-network-error|react-merge-refs)).+$",
46+
],
4547
collectCoverageFrom: [
4648
"<rootDir>/src/**/*.{js,ts,tsx}",
4749
// getSessionLock is piped into a different JS context via stringification, and the coverage functionality is

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
"react-blurhash": "^0.3.0",
151151
"react-dom": "^19.0.0",
152152
"react-focus-lock": "^2.5.1",
153+
"react-merge-refs": "^3.0.2",
153154
"react-string-replace": "^1.1.1",
154155
"react-transition-group": "^4.4.1",
155156
"react-virtuoso": "^4.14.0",

playwright/e2e/crypto/crypto.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ const startDMWithBob = async (page: Page, bob: Bot) => {
2525
await page.getByRole("menuitem", { name: "Start chat" }).click();
2626
await page.getByTestId("invite-dialog-input").fill(bob.credentials.userId);
2727
await page.getByRole("option", { name: bob.credentials.displayName }).click();
28-
await expect(
29-
page.locator(".mx_InviteDialog_userTile_pill .mx_InviteDialog_userTile_name").getByText("Bob"),
30-
).toBeVisible();
28+
await expect(page.getByTestId("invite-dialog-input-wrapper").getByText("Bob")).toBeVisible();
3129
await page.getByRole("button", { name: "Go" }).click();
3230
};
3331

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ test.describe("Invite dialog", function () {
5454

5555
await other.getByRole("option", { name: botName }).click();
5656

57-
await expect(
58-
other.locator(".mx_InviteDialog_userTile_pill .mx_InviteDialog_userTile_name").getByText(botName),
59-
).toBeVisible();
57+
await expect(other.getByTestId("invite-dialog-input-wrapper").getByText(botName)).toBeVisible();
6058

6159
// Take a snapshot of the invite dialog with a user pill
6260
await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-room-with-user-pill.png");
@@ -95,9 +93,7 @@ test.describe("Invite dialog", function () {
9593
await expect(other.getByRole("option", { name: botName }).getByText(bot.credentials.userId)).toBeVisible();
9694
await other.getByRole("option", { name: botName }).click();
9795

98-
await expect(
99-
other.locator(".mx_InviteDialog_userTile_pill .mx_InviteDialog_userTile_name").getByText(botName),
100-
).toBeVisible();
96+
await expect(other.getByTestId("invite-dialog-input-wrapper").getByText(botName)).toBeVisible();
10197

10298
// Take a snapshot of the invite dialog with a user pill
10399
await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-dm-with-user-pill.png");
5.67 KB
Loading
5.53 KB
Loading
7.86 KB
Loading
7.04 KB
Loading
1.71 KB
Loading
-404 Bytes
Loading

0 commit comments

Comments
 (0)