This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 831
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Peter Scheu <[email protected]>
- Loading branch information
1 parent
771d7e9
commit 5ee8e61
Showing
2 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,7 @@ const aliceEmail = "[email protected]"; | |
const bobId = "@bob:example.org"; | ||
const bobEmail = "[email protected]"; // [email protected] 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()} />); | ||
|