Skip to content

Commit e74cd39

Browse files
committed
Merge tag 'v3.66.0' into sc
* Add option to find own location in map views ([\matrix-org#10083](matrix-org#10083)). * Render poll end events in timeline ([\matrix-org#10027](matrix-org#10027)). Contributed by @kerryarchibald. * Indicate unread messages in tab title ([\matrix-org#10096](matrix-org#10096)). Contributed by @tnt7864. * Open message in editing mode when keyboard up is pressed (RTE) ([\matrix-org#10079](matrix-org#10079)). Contributed by @florianduros. * Hide superseded rooms from the room list using dynamic room predecessors ([\matrix-org#10068](matrix-org#10068)). Contributed by @andybalaam. * Support MSC3946 in RoomListStore ([\matrix-org#10054](matrix-org#10054)). Fixes element-hq/element-web#24325. Contributed by @andybalaam. * Auto focus security key field ([\matrix-org#10048](matrix-org#10048)). * use Poll model with relations API in poll rendering ([\matrix-org#9877](matrix-org#9877)). Contributed by @kerryarchibald. * Support MSC3946 in the RoomCreate tile ([\matrix-org#10041](matrix-org#10041)). Fixes element-hq/element-web#24323. Contributed by @andybalaam. * Update labs flag description for RTE ([\matrix-org#10058](matrix-org#10058)). Contributed by @florianduros. * Change ul list style to disc when editing message ([\matrix-org#10043](matrix-org#10043)). Contributed by @alunturner. * Improved click detection within PiP windows ([\matrix-org#10040](matrix-org#10040)). Fixes element-hq/element-web#24371. * Add RTE keyboard navigation in editing ([\matrix-org#9980](matrix-org#9980)). Fixes element-hq/element-web#23621. Contributed by @florianduros. * Paragraph integration for rich text editor ([\matrix-org#10008](matrix-org#10008)). Contributed by @alunturner. * Add indentation increasing/decreasing to RTE ([\matrix-org#10034](matrix-org#10034)). Contributed by @florianduros. * Add ignore user confirmation dialog ([\matrix-org#6116](matrix-org#6116)). Fixes element-hq/element-web#14746. * Use monospace font for room, message IDs in View Source modal ([\matrix-org#9956](matrix-org#9956)). Fixes element-hq/element-web#21937. Contributed by @paragpoddar. * Implement MSC3946 for AdvancedRoomSettingsTab ([\matrix-org#9995](matrix-org#9995)). Fixes element-hq/element-web#24322. Contributed by @andybalaam. * Implementation of MSC3824 to make the client OIDC-aware ([\matrix-org#8681](matrix-org#8681)). Contributed by @hughns. * Improves a11y for avatar uploads ([\matrix-org#9985](matrix-org#9985)). Contributed by @GoodGuyMarco. * Add support for [token authenticated registration](https ([\matrix-org#7275](matrix-org#7275)). Fixes element-hq/element-web#18931. Contributed by @govynnus. * Remove duplicate white space characters from translation keys ([\matrix-org#10152](matrix-org#10152)). Contributed by @luixxiul. * Fix the caption of new sessions manager on Labs settings page for localization ([\matrix-org#10143](matrix-org#10143)). Contributed by @luixxiul. * Prevent start another DM with a user if one already exists ([\matrix-org#10127](matrix-org#10127)). Fixes element-hq/element-web#23138. * Remove white space characters before the horizontal ellipsis ([\matrix-org#10130](matrix-org#10130)). Contributed by @luixxiul. * Fix Selectable Text on 'Delete All' and 'Retry All' Buttons ([\matrix-org#10128](matrix-org#10128)). Fixes element-hq/element-web#23232. Contributed by @akshattchhabra. * Correctly Identify emoticons ([\matrix-org#10108](matrix-org#10108)). Fixes element-hq/element-web#19472. Contributed by @adarsh-sgh. * Should open new 1:1 chat room after leaving the old one ([\matrix-org#9880](matrix-org#9880)). Contributed by @ahmadkadri. * Remove a redundant white space ([\matrix-org#10129](matrix-org#10129)). Contributed by @luixxiul. * Fix a crash when removing persistent widgets (updated) ([\matrix-org#10099](matrix-org#10099)). Fixes element-hq/element-web#24412. Contributed by @andybalaam. * Fix wrongly grouping 3pid invites into a single repeated transition ([\matrix-org#10087](matrix-org#10087)). Fixes element-hq/element-web#24432. * Fix scrollbar colliding with checkbox in add to space section ([\matrix-org#10093](matrix-org#10093)). Fixes element-hq/element-web#23189. Contributed by @Arnabdaz. * Add a whitespace character after 'broadcast?' ([\matrix-org#10097](matrix-org#10097)). Contributed by @luixxiul. * Seekbar in broadcast PiP view is now updated when switching between different broadcasts ([\matrix-org#10072](matrix-org#10072)). Fixes element-hq/element-web#24415. * Add border to "reject" button on room preview card for clickable area indication. It fixes element-hq/element-web#22623 ([\matrix-org#9205](matrix-org#9205)). Contributed by @gefgu. * Element-R: fix rageshages ([\matrix-org#10081](matrix-org#10081)). Fixes element-hq/element-web#24430. * Fix markdown paragraph display in timeline ([\matrix-org#10071](matrix-org#10071)). Fixes element-hq/element-web#24419. Contributed by @alunturner. * Prevent the remaining broadcast time from being exceeded ([\matrix-org#10070](matrix-org#10070)). * Fix cursor position when new line is created by pressing enter (RTE) ([\matrix-org#10064](matrix-org#10064)). Contributed by @florianduros. * Ensure room is actually in space hierarchy when resolving its latest version ([\matrix-org#10010](matrix-org#10010)). * Fix new line for inline code ([\matrix-org#10062](matrix-org#10062)). Contributed by @florianduros. * Member avatars without canvas ([\matrix-org#9990](matrix-org#9990)). Contributed by @clarkf. * Apply more general fix for base avatar regressions ([\matrix-org#10045](matrix-org#10045)). Fixes element-hq/element-web#24382 and element-hq/element-web#24370. * Replace list, code block and quote icons by new icons ([\matrix-org#10035](matrix-org#10035)). Contributed by @florianduros. * fix regional emojis converted to flags ([\matrix-org#9294](matrix-org#9294)). Fixes element-hq/element-web#19000. Contributed by @grimhilt. * resolved emoji description text overflowing issue ([\matrix-org#10028](matrix-org#10028)). Contributed by @fahadNoufal. * Fix MessageEditHistoryDialog crashing on complex input ([\matrix-org#10018](matrix-org#10018)). Fixes element-hq/element-web#23665. Contributed by @clarkf. * Unify unread notification state determination ([\matrix-org#9941](matrix-org#9941)). Contributed by @clarkf. * Fix layout and visual regressions around default avatars ([\matrix-org#10031](matrix-org#10031)). Fixes element-hq/element-web#24375 and element-hq/element-web#24369. * Fix useUnreadNotifications exploding with falsey room, like in notif panel ([\matrix-org#10030](matrix-org#10030)). Fixes matrix-org/element-web-rageshakes#19334. * Fix "[object Promise]" appearing in HTML exports ([\matrix-org#9975](matrix-org#9975)). Fixes element-hq/element-web#24272. Contributed by @clarkf. * changing the color of message time stamp ([\matrix-org#10016](matrix-org#10016)). Contributed by @nawarajshah. * Fix link creation with backward selection ([\matrix-org#9986](matrix-org#9986)). Fixes element-hq/element-web#24315. Contributed by @florianduros. * Misaligned reply preview in thread composer #23396 ([\matrix-org#9977](matrix-org#9977)). Fixes element-hq/element-web#23396. Contributed by @mustafa-kapadia1483.
2 parents 8ba7e27 + 45cce24 commit e74cd39

File tree

236 files changed

+8271
-2625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+8271
-2625
lines changed

Diff for: .eslintrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module.exports = {
22
plugins: ["matrix-org"],
33
extends: ["plugin:matrix-org/babel", "plugin:matrix-org/react", "plugin:matrix-org/a11y"],
4+
parserOptions: {
5+
project: ["./tsconfig.json"],
6+
},
47
env: {
58
browser: true,
69
node: true,
@@ -168,6 +171,12 @@ module.exports = {
168171
"@typescript-eslint/explicit-member-accessibility": "off",
169172
},
170173
},
174+
{
175+
files: ["cypress/**/*.ts"],
176+
parserOptions: {
177+
project: ["./cypress/tsconfig.json"],
178+
},
179+
},
171180
],
172181
settings: {
173182
react: {

Diff for: CHANGELOG.md

+62
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
1+
Changes in [3.66.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.66.0) (2023-02-14)
2+
=====================================================================================================
3+
4+
## ✨ Features
5+
* Add option to find own location in map views ([\#10083](https://github.com/matrix-org/matrix-react-sdk/pull/10083)).
6+
* Render poll end events in timeline ([\#10027](https://github.com/matrix-org/matrix-react-sdk/pull/10027)). Contributed by @kerryarchibald.
7+
* Indicate unread messages in tab title ([\#10096](https://github.com/matrix-org/matrix-react-sdk/pull/10096)). Contributed by @tnt7864.
8+
* Open message in editing mode when keyboard up is pressed (RTE) ([\#10079](https://github.com/matrix-org/matrix-react-sdk/pull/10079)). Contributed by @florianduros.
9+
* Hide superseded rooms from the room list using dynamic room predecessors ([\#10068](https://github.com/matrix-org/matrix-react-sdk/pull/10068)). Contributed by @andybalaam.
10+
* Support MSC3946 in RoomListStore ([\#10054](https://github.com/matrix-org/matrix-react-sdk/pull/10054)). Fixes vector-im/element-web#24325. Contributed by @andybalaam.
11+
* Auto focus security key field ([\#10048](https://github.com/matrix-org/matrix-react-sdk/pull/10048)).
12+
* use Poll model with relations API in poll rendering ([\#9877](https://github.com/matrix-org/matrix-react-sdk/pull/9877)). Contributed by @kerryarchibald.
13+
* Support MSC3946 in the RoomCreate tile ([\#10041](https://github.com/matrix-org/matrix-react-sdk/pull/10041)). Fixes vector-im/element-web#24323. Contributed by @andybalaam.
14+
* Update labs flag description for RTE ([\#10058](https://github.com/matrix-org/matrix-react-sdk/pull/10058)). Contributed by @florianduros.
15+
* Change ul list style to disc when editing message ([\#10043](https://github.com/matrix-org/matrix-react-sdk/pull/10043)). Contributed by @alunturner.
16+
* Improved click detection within PiP windows ([\#10040](https://github.com/matrix-org/matrix-react-sdk/pull/10040)). Fixes vector-im/element-web#24371.
17+
* Add RTE keyboard navigation in editing ([\#9980](https://github.com/matrix-org/matrix-react-sdk/pull/9980)). Fixes vector-im/element-web#23621. Contributed by @florianduros.
18+
* Paragraph integration for rich text editor ([\#10008](https://github.com/matrix-org/matrix-react-sdk/pull/10008)). Contributed by @alunturner.
19+
* Add indentation increasing/decreasing to RTE ([\#10034](https://github.com/matrix-org/matrix-react-sdk/pull/10034)). Contributed by @florianduros.
20+
* Add ignore user confirmation dialog ([\#6116](https://github.com/matrix-org/matrix-react-sdk/pull/6116)). Fixes vector-im/element-web#14746.
21+
* Use monospace font for room, message IDs in View Source modal ([\#9956](https://github.com/matrix-org/matrix-react-sdk/pull/9956)). Fixes vector-im/element-web#21937. Contributed by @paragpoddar.
22+
* Implement MSC3946 for AdvancedRoomSettingsTab ([\#9995](https://github.com/matrix-org/matrix-react-sdk/pull/9995)). Fixes vector-im/element-web#24322. Contributed by @andybalaam.
23+
* Implementation of MSC3824 to make the client OIDC-aware ([\#8681](https://github.com/matrix-org/matrix-react-sdk/pull/8681)). Contributed by @hughns.
24+
* Improves a11y for avatar uploads ([\#9985](https://github.com/matrix-org/matrix-react-sdk/pull/9985)). Contributed by @GoodGuyMarco.
25+
* Add support for [token authenticated registration](https ([\#7275](https://github.com/matrix-org/matrix-react-sdk/pull/7275)). Fixes vector-im/element-web#18931. Contributed by @govynnus.
26+
27+
## 🐛 Bug Fixes
28+
* Remove duplicate white space characters from translation keys ([\#10152](https://github.com/matrix-org/matrix-react-sdk/pull/10152)). Contributed by @luixxiul.
29+
* Fix the caption of new sessions manager on Labs settings page for localization ([\#10143](https://github.com/matrix-org/matrix-react-sdk/pull/10143)). Contributed by @luixxiul.
30+
* Prevent start another DM with a user if one already exists ([\#10127](https://github.com/matrix-org/matrix-react-sdk/pull/10127)). Fixes vector-im/element-web#23138.
31+
* Remove white space characters before the horizontal ellipsis ([\#10130](https://github.com/matrix-org/matrix-react-sdk/pull/10130)). Contributed by @luixxiul.
32+
* Fix Selectable Text on 'Delete All' and 'Retry All' Buttons ([\#10128](https://github.com/matrix-org/matrix-react-sdk/pull/10128)). Fixes vector-im/element-web#23232. Contributed by @akshattchhabra.
33+
* Correctly Identify emoticons ([\#10108](https://github.com/matrix-org/matrix-react-sdk/pull/10108)). Fixes vector-im/element-web#19472. Contributed by @adarsh-sgh.
34+
* Should open new 1:1 chat room after leaving the old one ([\#9880](https://github.com/matrix-org/matrix-react-sdk/pull/9880)). Contributed by @ahmadkadri.
35+
* Remove a redundant white space ([\#10129](https://github.com/matrix-org/matrix-react-sdk/pull/10129)). Contributed by @luixxiul.
36+
* Fix a crash when removing persistent widgets (updated) ([\#10099](https://github.com/matrix-org/matrix-react-sdk/pull/10099)). Fixes vector-im/element-web#24412. Contributed by @andybalaam.
37+
* Fix wrongly grouping 3pid invites into a single repeated transition ([\#10087](https://github.com/matrix-org/matrix-react-sdk/pull/10087)). Fixes vector-im/element-web#24432.
38+
* Fix scrollbar colliding with checkbox in add to space section ([\#10093](https://github.com/matrix-org/matrix-react-sdk/pull/10093)). Fixes vector-im/element-web#23189. Contributed by @Arnabdaz.
39+
* Add a whitespace character after 'broadcast?' ([\#10097](https://github.com/matrix-org/matrix-react-sdk/pull/10097)). Contributed by @luixxiul.
40+
* Seekbar in broadcast PiP view is now updated when switching between different broadcasts ([\#10072](https://github.com/matrix-org/matrix-react-sdk/pull/10072)). Fixes vector-im/element-web#24415.
41+
* Add border to "reject" button on room preview card for clickable area indication. It fixes vector-im/element-web#22623 ([\#9205](https://github.com/matrix-org/matrix-react-sdk/pull/9205)). Contributed by @gefgu.
42+
* Element-R: fix rageshages ([\#10081](https://github.com/matrix-org/matrix-react-sdk/pull/10081)). Fixes vector-im/element-web#24430.
43+
* Fix markdown paragraph display in timeline ([\#10071](https://github.com/matrix-org/matrix-react-sdk/pull/10071)). Fixes vector-im/element-web#24419. Contributed by @alunturner.
44+
* Prevent the remaining broadcast time from being exceeded ([\#10070](https://github.com/matrix-org/matrix-react-sdk/pull/10070)).
45+
* Fix cursor position when new line is created by pressing enter (RTE) ([\#10064](https://github.com/matrix-org/matrix-react-sdk/pull/10064)). Contributed by @florianduros.
46+
* Ensure room is actually in space hierarchy when resolving its latest version ([\#10010](https://github.com/matrix-org/matrix-react-sdk/pull/10010)).
47+
* Fix new line for inline code ([\#10062](https://github.com/matrix-org/matrix-react-sdk/pull/10062)). Contributed by @florianduros.
48+
* Member avatars without canvas ([\#9990](https://github.com/matrix-org/matrix-react-sdk/pull/9990)). Contributed by @clarkf.
49+
* Apply more general fix for base avatar regressions ([\#10045](https://github.com/matrix-org/matrix-react-sdk/pull/10045)). Fixes vector-im/element-web#24382 and vector-im/element-web#24370.
50+
* Replace list, code block and quote icons by new icons ([\#10035](https://github.com/matrix-org/matrix-react-sdk/pull/10035)). Contributed by @florianduros.
51+
* fix regional emojis converted to flags ([\#9294](https://github.com/matrix-org/matrix-react-sdk/pull/9294)). Fixes vector-im/element-web#19000. Contributed by @grimhilt.
52+
* resolved emoji description text overflowing issue ([\#10028](https://github.com/matrix-org/matrix-react-sdk/pull/10028)). Contributed by @fahadNoufal.
53+
* Fix MessageEditHistoryDialog crashing on complex input ([\#10018](https://github.com/matrix-org/matrix-react-sdk/pull/10018)). Fixes vector-im/element-web#23665. Contributed by @clarkf.
54+
* Unify unread notification state determination ([\#9941](https://github.com/matrix-org/matrix-react-sdk/pull/9941)). Contributed by @clarkf.
55+
* Fix layout and visual regressions around default avatars ([\#10031](https://github.com/matrix-org/matrix-react-sdk/pull/10031)). Fixes vector-im/element-web#24375 and vector-im/element-web#24369.
56+
* Fix useUnreadNotifications exploding with falsey room, like in notif panel ([\#10030](https://github.com/matrix-org/matrix-react-sdk/pull/10030)). Fixes matrix-org/element-web-rageshakes#19334.
57+
* Fix "[object Promise]" appearing in HTML exports ([\#9975](https://github.com/matrix-org/matrix-react-sdk/pull/9975)). Fixes vector-im/element-web#24272. Contributed by @clarkf.
58+
* changing the color of message time stamp ([\#10016](https://github.com/matrix-org/matrix-react-sdk/pull/10016)). Contributed by @nawarajshah.
59+
* Fix link creation with backward selection ([\#9986](https://github.com/matrix-org/matrix-react-sdk/pull/9986)). Fixes vector-im/element-web#24315. Contributed by @florianduros.
60+
* Misaligned reply preview in thread composer #23396 ([\#9977](https://github.com/matrix-org/matrix-react-sdk/pull/9977)). Fixes vector-im/element-web#23396. Contributed by @mustafa-kapadia1483.
61+
62+
163
Changes in [3.65.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.65.0) (2023-01-31)
264
=====================================================================================================
365

Diff for: cypress/e2e/composer/composer.spec.ts

+21-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe("Composer", () => {
9898
});
9999
});
100100

101-
describe("WYSIWYG", () => {
101+
describe("Rich text editor", () => {
102102
beforeEach(() => {
103103
cy.enableLabsFeature("feature_wysiwyg_composer");
104104
cy.initTestUser(homeserver, "Janet").then(() => {
@@ -165,5 +165,25 @@ describe("Composer", () => {
165165
cy.contains(".mx_EventTile_body", "my message 3");
166166
});
167167
});
168+
169+
describe("links", () => {
170+
it("create link with a forward selection", () => {
171+
// Type a message
172+
cy.get("div[contenteditable=true]").type("my message 0{selectAll}");
173+
174+
// Open link modal
175+
cy.get('button[aria-label="Link"]').click();
176+
// Fill the link field
177+
cy.get('input[label="Link"]').type("https://matrix.org/");
178+
// Click on save
179+
cy.get('button[type="submit"]').click();
180+
// Send the message
181+
cy.get('div[aria-label="Send message"]').click();
182+
183+
// It was sent
184+
cy.contains(".mx_EventTile_body a", "my message 0");
185+
cy.get(".mx_EventTile_body a").should("have.attr", "href").and("include", "https://matrix.org/");
186+
});
187+
});
168188
});
169189
});

Diff for: cypress/e2e/crypto/decryption-failure.spec.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const handleVerificationRequest = (request: VerificationRequest): Chainable<Emoj
5252
verifier.on("show_sas", onShowSas);
5353
verifier.verify();
5454
}),
55+
// extra timeout, as this sometimes takes a while
56+
{ timeout: 30_000 },
5557
);
5658
};
5759

@@ -111,9 +113,8 @@ describe("Decryption Failure Bar", () => {
111113
})
112114
.then(() => {
113115
cy.botSendMessage(bot, roomId, "test");
114-
cy.wait(5000);
115-
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
116-
"have.text",
116+
cy.contains(
117+
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
117118
"Verify this device to access all messages",
118119
);
119120

@@ -124,6 +125,7 @@ describe("Decryption Failure Bar", () => {
124125

125126
const verificationRequestPromise = waitForVerificationRequest(otherDevice);
126127
cy.get(".mx_CompleteSecurity_actionRow .mx_AccessibleButton").click();
128+
cy.contains("To proceed, please accept the verification request on your other device.");
127129
cy.wrap(verificationRequestPromise).then((verificationRequest: VerificationRequest) => {
128130
cy.wrap(verificationRequest.accept());
129131
handleVerificationRequest(verificationRequest).then((emojis) => {
@@ -170,9 +172,8 @@ describe("Decryption Failure Bar", () => {
170172
);
171173

172174
cy.botSendMessage(bot, roomId, "test");
173-
cy.wait(5000);
174-
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
175-
"have.text",
175+
cy.contains(
176+
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
176177
"Reset your keys to prevent future decryption errors",
177178
);
178179

Diff for: cypress/e2e/one-to-one-chat/one-to-one-chat.spec.ts

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
Copyright 2023 Ahmad Kadri
3+
Copyright 2023 Nordeck IT + Consulting GmbH.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
/// <reference types="cypress" />
19+
20+
import { HomeserverInstance } from "../../plugins/utils/homeserver";
21+
import { Credentials } from "../../support/homeserver";
22+
23+
describe("1:1 chat room", () => {
24+
let homeserver: HomeserverInstance;
25+
let user2: Credentials;
26+
27+
const username = "user1234";
28+
const password = "p4s5W0rD";
29+
30+
beforeEach(() => {
31+
cy.startHomeserver("default").then((data) => {
32+
homeserver = data;
33+
34+
cy.initTestUser(homeserver, "Jeff");
35+
cy.registerUser(homeserver, username, password).then((credential) => {
36+
user2 = credential;
37+
cy.visit(`/#/user/${user2.userId}?action=chat`);
38+
});
39+
});
40+
});
41+
42+
afterEach(() => {
43+
cy.stopHomeserver(homeserver);
44+
});
45+
46+
it("should open new 1:1 chat room after leaving the old one", () => {
47+
// leave 1:1 chat room
48+
cy.contains(".mx_RoomHeader_nametext", username).click();
49+
cy.contains('[role="menuitem"]', "Leave").click();
50+
cy.get('[data-testid="dialog-primary-button"]').click();
51+
52+
// wait till the room was left
53+
cy.get('[role="group"][aria-label="Historical"]').within(() => {
54+
cy.contains(".mx_RoomTile", username);
55+
});
56+
57+
// open new 1:1 chat room
58+
cy.visit(`/#/user/${user2.userId}?action=chat`);
59+
cy.contains(".mx_RoomHeader_nametext", username);
60+
});
61+
});

Diff for: cypress/e2e/spaces/spaces.spec.ts

+29-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
/// <reference types="cypress" />
1818

1919
import type { MatrixClient } from "matrix-js-sdk/src/client";
20+
import type { Preset } from "matrix-js-sdk/src/@types/partials";
2021
import type { ICreateRoomOpts } from "matrix-js-sdk/src/@types/requests";
2122
import { HomeserverInstance } from "../../plugins/utils/homeserver";
2223
import Chainable = Cypress.Chainable;
@@ -32,7 +33,7 @@ function openSpaceContextMenu(spaceName: string): Chainable<JQuery> {
3233
return cy.get(".mx_SpacePanel_contextMenu");
3334
}
3435

35-
function spaceCreateOptions(spaceName: string): ICreateRoomOpts {
36+
function spaceCreateOptions(spaceName: string, roomIds: string[] = []): ICreateRoomOpts {
3637
return {
3738
creation_content: {
3839
type: "m.space",
@@ -44,6 +45,7 @@ function spaceCreateOptions(spaceName: string): ICreateRoomOpts {
4445
name: spaceName,
4546
},
4647
},
48+
...roomIds.map(spaceChildInitialState),
4749
],
4850
};
4951
}
@@ -77,7 +79,7 @@ describe("Spaces", () => {
7779
cy.stopHomeserver(homeserver);
7880
});
7981

80-
it.only("should allow user to create public space", () => {
82+
it("should allow user to create public space", () => {
8183
openSpaceCreateMenu();
8284
cy.get("#mx_ContextualMenu_Container").percySnapshotElement("Space create menu");
8385
cy.get(".mx_SpaceCreateMenu_wrapper .mx_ContextualMenu").within(() => {
@@ -283,4 +285,29 @@ describe("Spaces", () => {
283285
cy.checkA11y(undefined, axeOptions);
284286
cy.get(".mx_SpacePanel").percySnapshotElement("Space panel expanded", { widths: [258] });
285287
});
288+
289+
it("should not soft crash when joining a room from space hierarchy which has a link in its topic", () => {
290+
cy.getBot(homeserver, { displayName: "BotBob" }).then({ timeout: 10000 }, async (bot) => {
291+
const { room_id: roomId } = await bot.createRoom({
292+
preset: "public_chat" as Preset,
293+
name: "Test Room",
294+
topic: "This is a topic https://github.com/matrix-org/matrix-react-sdk/pull/10060 with a link",
295+
});
296+
const { room_id: spaceId } = await bot.createRoom(spaceCreateOptions("Test Space", [roomId]));
297+
await bot.invite(spaceId, user.userId);
298+
});
299+
300+
cy.getSpacePanelButton("Test Space").should("exist");
301+
cy.wait(500); // without this we can end up clicking too quickly and it ends up having no effect
302+
cy.viewSpaceByName("Test Space");
303+
cy.contains(".mx_AccessibleButton", "Accept").click();
304+
305+
cy.contains(".mx_SpaceHierarchy_roomTile.mx_AccessibleButton", "Test Room").within(() => {
306+
cy.contains("Join").should("exist").realHover().click();
307+
cy.contains("View", { timeout: 5000 }).should("exist").click();
308+
});
309+
310+
// Assert we get shown the new room intro, and thus not the soft crash screen
311+
cy.get(".mx_NewRoomIntro").should("exist");
312+
});
286313
});

Diff for: cypress/e2e/timeline/timeline.spec.ts

+20-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ describe("Timeline", () => {
250250
cy.contains(".mx_RoomView_body .mx_EventTile[data-scroll-tokens]", "MessageEdit").should("exist");
251251

252252
// Click top left of the event toggle, which should not be covered by MessageActionBar's safe area
253-
cy.get(".mx_EventTile .mx_ViewSourceEvent")
253+
cy.get(".mx_EventTile:not(:first-child) .mx_ViewSourceEvent")
254254
.should("exist")
255255
.realHover()
256256
.within(() => {
@@ -384,5 +384,24 @@ describe("Timeline", () => {
384384
1,
385385
);
386386
});
387+
388+
it("should not be possible to send flag with regional emojis", () => {
389+
cy.visit("/#/room/" + roomId);
390+
391+
// Send a message
392+
cy.getComposer().type(":regional_indicator_a");
393+
cy.contains(".mx_Autocomplete_Completion_title", ":regional_indicator_a:").click();
394+
cy.getComposer().type(":regional_indicator_r");
395+
cy.contains(".mx_Autocomplete_Completion_title", ":regional_indicator_r:").click();
396+
cy.getComposer().type(" :regional_indicator_z");
397+
cy.contains(".mx_Autocomplete_Completion_title", ":regional_indicator_z:").click();
398+
cy.getComposer().type(":regional_indicator_a");
399+
cy.contains(".mx_Autocomplete_Completion_title", ":regional_indicator_a:").click();
400+
cy.getComposer().type("{enter}");
401+
402+
cy.get(".mx_RoomView_body .mx_EventTile .mx_EventTile_line .mx_MTextBody .mx_EventTile_bigEmoji")
403+
.children()
404+
.should("have.length", 4);
405+
});
387406
});
388407
});

Diff for: cypress/support/bot.ts

+2
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ function setupBotClient(
163163
}
164164
})
165165
.then(() => cli),
166+
// extra timeout, as this sometimes takes a while
167+
{ timeout: 30_000 },
166168
);
167169
});
168170
}

0 commit comments

Comments
 (0)