Skip to content

Commit

Permalink
Merge tag 'v3.66.0' into sc
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
su-ex committed Feb 27, 2023
2 parents 8ba7e27 + 45cce24 commit e74cd39
Show file tree
Hide file tree
Showing 236 changed files with 8,271 additions and 2,625 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
plugins: ["matrix-org"],
extends: ["plugin:matrix-org/babel", "plugin:matrix-org/react", "plugin:matrix-org/a11y"],
parserOptions: {
project: ["./tsconfig.json"],
},
env: {
browser: true,
node: true,
Expand Down Expand Up @@ -168,6 +171,12 @@ module.exports = {
"@typescript-eslint/explicit-member-accessibility": "off",
},
},
{
files: ["cypress/**/*.ts"],
parserOptions: {
project: ["./cypress/tsconfig.json"],
},
},
],
settings: {
react: {
Expand Down
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
Changes in [3.66.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.66.0) (2023-02-14)
=====================================================================================================

## ✨ Features
* Add option to find own location in map views ([\#10083](https://github.com/matrix-org/matrix-react-sdk/pull/10083)).
* Render poll end events in timeline ([\#10027](https://github.com/matrix-org/matrix-react-sdk/pull/10027)). Contributed by @kerryarchibald.
* Indicate unread messages in tab title ([\#10096](https://github.com/matrix-org/matrix-react-sdk/pull/10096)). Contributed by @tnt7864.
* 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.
* 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.
* Support MSC3946 in RoomListStore ([\#10054](https://github.com/matrix-org/matrix-react-sdk/pull/10054)). Fixes vector-im/element-web#24325. Contributed by @andybalaam.
* Auto focus security key field ([\#10048](https://github.com/matrix-org/matrix-react-sdk/pull/10048)).
* use Poll model with relations API in poll rendering ([\#9877](https://github.com/matrix-org/matrix-react-sdk/pull/9877)). Contributed by @kerryarchibald.
* 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.
* Update labs flag description for RTE ([\#10058](https://github.com/matrix-org/matrix-react-sdk/pull/10058)). Contributed by @florianduros.
* Change ul list style to disc when editing message ([\#10043](https://github.com/matrix-org/matrix-react-sdk/pull/10043)). Contributed by @alunturner.
* Improved click detection within PiP windows ([\#10040](https://github.com/matrix-org/matrix-react-sdk/pull/10040)). Fixes vector-im/element-web#24371.
* 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.
* Paragraph integration for rich text editor ([\#10008](https://github.com/matrix-org/matrix-react-sdk/pull/10008)). Contributed by @alunturner.
* Add indentation increasing/decreasing to RTE ([\#10034](https://github.com/matrix-org/matrix-react-sdk/pull/10034)). Contributed by @florianduros.
* Add ignore user confirmation dialog ([\#6116](https://github.com/matrix-org/matrix-react-sdk/pull/6116)). Fixes vector-im/element-web#14746.
* 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.
* Implement MSC3946 for AdvancedRoomSettingsTab ([\#9995](https://github.com/matrix-org/matrix-react-sdk/pull/9995)). Fixes vector-im/element-web#24322. Contributed by @andybalaam.
* Implementation of MSC3824 to make the client OIDC-aware ([\#8681](https://github.com/matrix-org/matrix-react-sdk/pull/8681)). Contributed by @hughns.
* Improves a11y for avatar uploads ([\#9985](https://github.com/matrix-org/matrix-react-sdk/pull/9985)). Contributed by @GoodGuyMarco.
* 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.

## 🐛 Bug Fixes
* Remove duplicate white space characters from translation keys ([\#10152](https://github.com/matrix-org/matrix-react-sdk/pull/10152)). Contributed by @luixxiul.
* 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.
* 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.
* Remove white space characters before the horizontal ellipsis ([\#10130](https://github.com/matrix-org/matrix-react-sdk/pull/10130)). Contributed by @luixxiul.
* 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.
* Correctly Identify emoticons ([\#10108](https://github.com/matrix-org/matrix-react-sdk/pull/10108)). Fixes vector-im/element-web#19472. Contributed by @adarsh-sgh.
* 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.
* Remove a redundant white space ([\#10129](https://github.com/matrix-org/matrix-react-sdk/pull/10129)). Contributed by @luixxiul.
* 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.
* 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.
* 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.
* Add a whitespace character after 'broadcast?' ([\#10097](https://github.com/matrix-org/matrix-react-sdk/pull/10097)). Contributed by @luixxiul.
* 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.
* 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.
* Element-R: fix rageshages ([\#10081](https://github.com/matrix-org/matrix-react-sdk/pull/10081)). Fixes vector-im/element-web#24430.
* 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.
* Prevent the remaining broadcast time from being exceeded ([\#10070](https://github.com/matrix-org/matrix-react-sdk/pull/10070)).
* 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.
* Ensure room is actually in space hierarchy when resolving its latest version ([\#10010](https://github.com/matrix-org/matrix-react-sdk/pull/10010)).
* Fix new line for inline code ([\#10062](https://github.com/matrix-org/matrix-react-sdk/pull/10062)). Contributed by @florianduros.
* Member avatars without canvas ([\#9990](https://github.com/matrix-org/matrix-react-sdk/pull/9990)). Contributed by @clarkf.
* 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.
* Replace list, code block and quote icons by new icons ([\#10035](https://github.com/matrix-org/matrix-react-sdk/pull/10035)). Contributed by @florianduros.
* 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.
* resolved emoji description text overflowing issue ([\#10028](https://github.com/matrix-org/matrix-react-sdk/pull/10028)). Contributed by @fahadNoufal.
* 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.
* Unify unread notification state determination ([\#9941](https://github.com/matrix-org/matrix-react-sdk/pull/9941)). Contributed by @clarkf.
* 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.
* 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.
* 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.
* changing the color of message time stamp ([\#10016](https://github.com/matrix-org/matrix-react-sdk/pull/10016)). Contributed by @nawarajshah.
* 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.
* 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.


Changes in [3.65.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.65.0) (2023-01-31)
=====================================================================================================

Expand Down
22 changes: 21 additions & 1 deletion cypress/e2e/composer/composer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("Composer", () => {
});
});

describe("WYSIWYG", () => {
describe("Rich text editor", () => {
beforeEach(() => {
cy.enableLabsFeature("feature_wysiwyg_composer");
cy.initTestUser(homeserver, "Janet").then(() => {
Expand Down Expand Up @@ -165,5 +165,25 @@ describe("Composer", () => {
cy.contains(".mx_EventTile_body", "my message 3");
});
});

describe("links", () => {
it("create link with a forward selection", () => {
// Type a message
cy.get("div[contenteditable=true]").type("my message 0{selectAll}");

// Open link modal
cy.get('button[aria-label="Link"]').click();
// Fill the link field
cy.get('input[label="Link"]').type("https://matrix.org/");
// Click on save
cy.get('button[type="submit"]').click();
// Send the message
cy.get('div[aria-label="Send message"]').click();

// It was sent
cy.contains(".mx_EventTile_body a", "my message 0");
cy.get(".mx_EventTile_body a").should("have.attr", "href").and("include", "https://matrix.org/");
});
});
});
});
13 changes: 7 additions & 6 deletions cypress/e2e/crypto/decryption-failure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const handleVerificationRequest = (request: VerificationRequest): Chainable<Emoj
verifier.on("show_sas", onShowSas);
verifier.verify();
}),
// extra timeout, as this sometimes takes a while
{ timeout: 30_000 },
);
};

Expand Down Expand Up @@ -111,9 +113,8 @@ describe("Decryption Failure Bar", () => {
})
.then(() => {
cy.botSendMessage(bot, roomId, "test");
cy.wait(5000);
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
"have.text",
cy.contains(
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
"Verify this device to access all messages",
);

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

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

cy.botSendMessage(bot, roomId, "test");
cy.wait(5000);
cy.get(".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline").should(
"have.text",
cy.contains(
".mx_DecryptionFailureBar .mx_DecryptionFailureBar_message_headline",
"Reset your keys to prevent future decryption errors",
);

Expand Down
61 changes: 61 additions & 0 deletions cypress/e2e/one-to-one-chat/one-to-one-chat.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
Copyright 2023 Ahmad Kadri
Copyright 2023 Nordeck IT + Consulting GmbH.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/// <reference types="cypress" />

import { HomeserverInstance } from "../../plugins/utils/homeserver";
import { Credentials } from "../../support/homeserver";

describe("1:1 chat room", () => {
let homeserver: HomeserverInstance;
let user2: Credentials;

const username = "user1234";
const password = "p4s5W0rD";

beforeEach(() => {
cy.startHomeserver("default").then((data) => {
homeserver = data;

cy.initTestUser(homeserver, "Jeff");
cy.registerUser(homeserver, username, password).then((credential) => {
user2 = credential;
cy.visit(`/#/user/${user2.userId}?action=chat`);
});
});
});

afterEach(() => {
cy.stopHomeserver(homeserver);
});

it("should open new 1:1 chat room after leaving the old one", () => {
// leave 1:1 chat room
cy.contains(".mx_RoomHeader_nametext", username).click();
cy.contains('[role="menuitem"]', "Leave").click();
cy.get('[data-testid="dialog-primary-button"]').click();

// wait till the room was left
cy.get('[role="group"][aria-label="Historical"]').within(() => {
cy.contains(".mx_RoomTile", username);
});

// open new 1:1 chat room
cy.visit(`/#/user/${user2.userId}?action=chat`);
cy.contains(".mx_RoomHeader_nametext", username);
});
});
31 changes: 29 additions & 2 deletions cypress/e2e/spaces/spaces.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
/// <reference types="cypress" />

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

function spaceCreateOptions(spaceName: string): ICreateRoomOpts {
function spaceCreateOptions(spaceName: string, roomIds: string[] = []): ICreateRoomOpts {
return {
creation_content: {
type: "m.space",
Expand All @@ -44,6 +45,7 @@ function spaceCreateOptions(spaceName: string): ICreateRoomOpts {
name: spaceName,
},
},
...roomIds.map(spaceChildInitialState),
],
};
}
Expand Down Expand Up @@ -77,7 +79,7 @@ describe("Spaces", () => {
cy.stopHomeserver(homeserver);
});

it.only("should allow user to create public space", () => {
it("should allow user to create public space", () => {
openSpaceCreateMenu();
cy.get("#mx_ContextualMenu_Container").percySnapshotElement("Space create menu");
cy.get(".mx_SpaceCreateMenu_wrapper .mx_ContextualMenu").within(() => {
Expand Down Expand Up @@ -283,4 +285,29 @@ describe("Spaces", () => {
cy.checkA11y(undefined, axeOptions);
cy.get(".mx_SpacePanel").percySnapshotElement("Space panel expanded", { widths: [258] });
});

it("should not soft crash when joining a room from space hierarchy which has a link in its topic", () => {
cy.getBot(homeserver, { displayName: "BotBob" }).then({ timeout: 10000 }, async (bot) => {
const { room_id: roomId } = await bot.createRoom({
preset: "public_chat" as Preset,
name: "Test Room",
topic: "This is a topic https://github.com/matrix-org/matrix-react-sdk/pull/10060 with a link",
});
const { room_id: spaceId } = await bot.createRoom(spaceCreateOptions("Test Space", [roomId]));
await bot.invite(spaceId, user.userId);
});

cy.getSpacePanelButton("Test Space").should("exist");
cy.wait(500); // without this we can end up clicking too quickly and it ends up having no effect
cy.viewSpaceByName("Test Space");
cy.contains(".mx_AccessibleButton", "Accept").click();

cy.contains(".mx_SpaceHierarchy_roomTile.mx_AccessibleButton", "Test Room").within(() => {
cy.contains("Join").should("exist").realHover().click();
cy.contains("View", { timeout: 5000 }).should("exist").click();
});

// Assert we get shown the new room intro, and thus not the soft crash screen
cy.get(".mx_NewRoomIntro").should("exist");
});
});
21 changes: 20 additions & 1 deletion cypress/e2e/timeline/timeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe("Timeline", () => {
cy.contains(".mx_RoomView_body .mx_EventTile[data-scroll-tokens]", "MessageEdit").should("exist");

// Click top left of the event toggle, which should not be covered by MessageActionBar's safe area
cy.get(".mx_EventTile .mx_ViewSourceEvent")
cy.get(".mx_EventTile:not(:first-child) .mx_ViewSourceEvent")
.should("exist")
.realHover()
.within(() => {
Expand Down Expand Up @@ -384,5 +384,24 @@ describe("Timeline", () => {
1,
);
});

it("should not be possible to send flag with regional emojis", () => {
cy.visit("/#/room/" + roomId);

// Send a message
cy.getComposer().type(":regional_indicator_a");
cy.contains(".mx_Autocomplete_Completion_title", ":regional_indicator_a:").click();
cy.getComposer().type(":regional_indicator_r");
cy.contains(".mx_Autocomplete_Completion_title", ":regional_indicator_r:").click();
cy.getComposer().type(" :regional_indicator_z");
cy.contains(".mx_Autocomplete_Completion_title", ":regional_indicator_z:").click();
cy.getComposer().type(":regional_indicator_a");
cy.contains(".mx_Autocomplete_Completion_title", ":regional_indicator_a:").click();
cy.getComposer().type("{enter}");

cy.get(".mx_RoomView_body .mx_EventTile .mx_EventTile_line .mx_MTextBody .mx_EventTile_bigEmoji")
.children()
.should("have.length", 4);
});
});
});
2 changes: 2 additions & 0 deletions cypress/support/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ function setupBotClient(
}
})
.then(() => cli),
// extra timeout, as this sometimes takes a while
{ timeout: 30_000 },
);
});
}
Expand Down
Loading

0 comments on commit e74cd39

Please sign in to comment.