From c235472b11fba93aa722fe2361413bf16ffc188c Mon Sep 17 00:00:00 2001 From: Peter Scheu Date: Thu, 20 Jul 2023 13:20:17 +0200 Subject: [PATCH] Search for users on paste Signed-off-by: Peter Scheu --- cypress/e2e/invite/invite-dialog.spec.ts | 12 ++++++++++++ src/components/views/dialogs/InviteDialog.tsx | 10 +++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/invite/invite-dialog.spec.ts b/cypress/e2e/invite/invite-dialog.spec.ts index 80edfa411d64..ef1337490d08 100644 --- a/cypress/e2e/invite/invite-dialog.spec.ts +++ b/cypress/e2e/invite/invite-dialog.spec.ts @@ -181,4 +181,16 @@ describe("Invite dialog", function () { // Assert that the message is displayed at the bottom cy.get(".mx_EventTile_last").findByText("Hello").should("exist"); }); + + it("should support pasting one username that is not a mx id or email", () => { + cy.get(".mx_RoomList").within(() => { + cy.findByRole("button", { name: "Start chat" }).click(); + }); + cy.get(".mx_InviteDialog_other").within(() => { + cy.findByTestId("invite-dialog-input").invoke("val", "test"); + cy.findByText("Failed to find the following users").should("not.exist"); + cy.findByTestId("invite-dialog-input").invoke("val", "test,test,test"); + cy.findByText("Failed to find the following users").should("exist"); + }); + }); }); diff --git a/src/components/views/dialogs/InviteDialog.tsx b/src/components/views/dialogs/InviteDialog.tsx index fa81a28bee05..05fe712bfa7c 100644 --- a/src/components/views/dialogs/InviteDialog.tsx +++ b/src/components/views/dialogs/InviteDialog.tsx @@ -870,11 +870,17 @@ export default class InviteDialog extends React.PureComponent m.userId === address); if (member) {