Fix url preview AXE and layout issue & add percy test (#9189)
This commit is contained in:
parent
0e43f3c015
commit
e269c6895d
3 changed files with 51 additions and 1 deletions
|
@ -274,6 +274,49 @@ describe("Timeline", () => {
|
|||
cy.get(".mx_EventTile:not(.mx_EventTile_contextual)").find(".mx_EventTile_searchHighlight").should("exist");
|
||||
cy.get(".mx_RoomView_searchResultsPanel").percySnapshotElement("Highlighted search results");
|
||||
});
|
||||
|
||||
it("should render url previews", () => {
|
||||
cy.intercept("**/_matrix/media/r0/thumbnail/matrix.org/2022-08-16_yaiSVSRIsNFfxDnV?*", {
|
||||
statusCode: 200,
|
||||
fixture: "riot.png",
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
},
|
||||
}).as("mxc");
|
||||
cy.intercept("**/_matrix/media/r0/preview_url?url=https%3A%2F%2Fcall.element.io%2F&ts=*", {
|
||||
statusCode: 200,
|
||||
body: {
|
||||
"og:title": "Element Call",
|
||||
"og:description": null,
|
||||
"og:image:width": 48,
|
||||
"og:image:height": 48,
|
||||
"og:image": "mxc://matrix.org/2022-08-16_yaiSVSRIsNFfxDnV",
|
||||
"og:image:type": "image/png",
|
||||
"matrix:image:size": 2121,
|
||||
},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}).as("preview_url");
|
||||
|
||||
cy.sendEvent(
|
||||
roomId,
|
||||
null,
|
||||
"m.room.message" as EventType,
|
||||
MessageEvent.from("https://call.element.io/").serialize().content,
|
||||
);
|
||||
cy.visit("/#/room/" + roomId);
|
||||
|
||||
cy.get(".mx_LinkPreviewWidget").should("exist").should("contain.text", "Element Call");
|
||||
|
||||
cy.wait("@preview_url");
|
||||
cy.wait("@mxc");
|
||||
|
||||
cy.checkA11y();
|
||||
cy.get(".mx_EventTile_last").percySnapshotElement("URL Preview", {
|
||||
widths: [800, 400],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("message sending", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue