-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New UX for `ShareDialog` * Use new named import * Rewrite tests * Add e2e tests * Use `box-sizing` for social buttons * Update e2e tests
- Loading branch information
1 parent
06fa348
commit 0429809
Showing
17 changed files
with
1,240 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright 2024 New Vector Ltd. | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only | ||
* Please see LICENSE files in the repository root for full details. | ||
*/ | ||
|
||
import { test, expect } from "../../element-web-test"; | ||
|
||
test.describe("Share dialog", () => { | ||
test.use({ | ||
displayName: "Alice", | ||
room: async ({ app, user, bot }, use) => { | ||
const roomId = await app.client.createRoom({ name: "Alice room" }); | ||
await use({ roomId }); | ||
}, | ||
}); | ||
|
||
test("should share a room", async ({ page, app, room }) => { | ||
await app.viewRoomById(room.roomId); | ||
await app.toggleRoomInfoPanel(); | ||
await page.getByRole("menuitem", { name: "Copy link" }).click(); | ||
|
||
const dialog = page.getByRole("dialog", { name: "Share room" }); | ||
await expect(dialog.getByText(`https://matrix.to/#/${room.roomId}`)).toBeVisible(); | ||
expect(dialog).toMatchScreenshot("share-dialog-room.png", { | ||
// QRCode and url changes at every run | ||
mask: [page.locator(".mx_QRCode"), page.locator(".mx_ShareDialog_top > span")], | ||
}); | ||
}); | ||
|
||
test("should share a room member", async ({ page, app, room, user }) => { | ||
await app.viewRoomById(room.roomId); | ||
await app.client.sendMessage(room.roomId, { body: "hello", msgtype: "m.text" }); | ||
|
||
const rightPanel = await app.toggleRoomInfoPanel(); | ||
await rightPanel.getByRole("menuitem", { name: "People" }).click(); | ||
await rightPanel.getByRole("button", { name: `${user.userId} (power 100)` }).click(); | ||
await rightPanel.getByRole("button", { name: "Share profile" }).click(); | ||
|
||
const dialog = page.getByRole("dialog", { name: "Share User" }); | ||
await expect(dialog.getByText(`https://matrix.to/#/${user.userId}`)).toBeVisible(); | ||
expect(dialog).toMatchScreenshot("share-dialog-user.png", { | ||
// QRCode changes at every run | ||
mask: [page.locator(".mx_QRCode")], | ||
}); | ||
}); | ||
|
||
test("should share an event", async ({ page, app, room }) => { | ||
await app.viewRoomById(room.roomId); | ||
await app.client.sendMessage(room.roomId, { body: "hello", msgtype: "m.text" }); | ||
|
||
const timelineMessage = page.locator(".mx_MTextBody", { hasText: "hello" }); | ||
await timelineMessage.hover(); | ||
await page.getByRole("button", { name: "Options", exact: true }).click(); | ||
await page.getByRole("menuitem", { name: "Share" }).click(); | ||
|
||
const dialog = page.getByRole("dialog", { name: "Share Room Message" }); | ||
await expect(dialog.getByRole("checkbox", { name: "Link to selected message" })).toBeChecked(); | ||
expect(dialog).toMatchScreenshot("share-dialog-event.png", { | ||
// QRCode and url changes at every run | ||
mask: [page.locator(".mx_QRCode"), page.locator(".mx_ShareDialog_top > span")], | ||
}); | ||
await dialog.getByRole("checkbox", { name: "Link to selected message" }).click(); | ||
await expect(dialog.getByRole("checkbox", { name: "Link to selected message" })).not.toBeChecked(); | ||
}); | ||
}); |
Binary file added
BIN
+17.4 KB
...wright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-event-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.5 KB
playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-room-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.4 KB
playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-user-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.