From d69f1a5cf9dc3b85d6f193ef60a2dca6b658adf8 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 80edfa411d6..db95eeb209e 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 7bb714c0254..179cfa980fa 100644 --- a/src/components/views/dialogs/InviteDialog.tsx +++ b/src/components/views/dialogs/InviteDialog.tsx @@ -866,11 +866,17 @@ export default class InviteDialog extends React.PureComponent m.userId === address); if (member) {