-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New UX for Share dialog #28598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
New UX for Share dialog #28598
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3717e8a
New UX for `ShareDialog`
florianduros f372de1
Use new named import
florianduros fdad4bd
Rewrite tests
florianduros 155426d
Add e2e tests
florianduros 41c2d15
Use `box-sizing` for social buttons
florianduros f098261
Update e2e tests
florianduros File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.