Search for users on paste (#11304)
Signed-off-by: Peter Scheu <peter.scheu@aceart.de>
This commit is contained in:
parent
771d7e95e7
commit
5ee8e61bf5
2 changed files with 21 additions and 3 deletions
|
@ -86,6 +86,7 @@ const aliceEmail = "foobar@email.com";
|
|||
const bobId = "@bob:example.org";
|
||||
const bobEmail = "bobbob@example.com"; // bob@example.com is already used as an example in the invite dialog
|
||||
const carolId = "@carol:example.com";
|
||||
const bobbob = "bobbob";
|
||||
|
||||
const aliceProfileInfo: IProfileInfo = {
|
||||
user_id: aliceId,
|
||||
|
@ -290,6 +291,19 @@ describe("InviteDialog", () => {
|
|||
await screen.findByText(aliceEmail);
|
||||
expect(input).toHaveValue("");
|
||||
});
|
||||
it("should support pasting one username that is not a mx id or email", async () => {
|
||||
mockClient.getIdentityServerUrl.mockReturnValue("https://identity-server");
|
||||
mockClient.lookupThreePid.mockResolvedValue({});
|
||||
|
||||
render(<InviteDialog kind={InviteKind.Invite} roomId={roomId} onFinished={jest.fn()} />);
|
||||
|
||||
const input = screen.getByTestId("invite-dialog-input");
|
||||
input.focus();
|
||||
await userEvent.paste(`${bobbob}`);
|
||||
|
||||
await screen.findAllByText(bobId);
|
||||
expect(input).toHaveValue(`${bobbob}`);
|
||||
});
|
||||
|
||||
it("should allow to invite multiple emails to a room", async () => {
|
||||
render(<InviteDialog kind={InviteKind.Invite} roomId={roomId} onFinished={jest.fn()} />);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue