Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 444e276

Browse files
RiotRobotdbkr
andauthored
[Backport staging] Fix image upload preview size (#12612)
Co-authored-by: David Baker <[email protected]>
1 parent 6dee68c commit 444e276

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
Copyright 2024 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
import { test, expect } from "../../element-web-test";
18+
19+
test.describe("Image Upload", () => {
20+
test.use({
21+
displayName: "Alice",
22+
});
23+
24+
test.beforeEach(async ({ page, app, user }) => {
25+
await app.client.createRoom({ name: "My Pictures" });
26+
await app.viewRoomByName("My Pictures");
27+
28+
// Wait until configuration is finished
29+
await expect(
30+
page
31+
.locator(".mx_GenericEventListSummary[data-layout='group'] .mx_GenericEventListSummary_summary")
32+
.getByText(`${user.displayName} created and configured the room.`),
33+
).toBeVisible();
34+
});
35+
36+
test("should show image preview when uploading an image", async ({ page, app }) => {
37+
await page
38+
.locator(".mx_MessageComposer_actions input[type='file']")
39+
.setInputFiles("playwright/sample-files/riot.png");
40+
41+
expect(page.getByRole("button", { name: "Upload" })).toBeEnabled();
42+
expect(page.getByRole("button", { name: "Close dialog" })).toBeEnabled();
43+
expect(page).toMatchScreenshot("image-upload-preview.png");
44+
});
45+
});
67.3 KB
Loading

res/css/_common.pcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ legend {
333333
z-index: var(--dialog-zIndex-standard);
334334
position: relative;
335335
width: 100%;
336-
max-width: min-content;
336+
max-width: fit-content;
337337
box-sizing: border-box;
338338
max-height: calc(100% - var(--cpd-space-6x));
339339
display: flex;

0 commit comments

Comments
 (0)