mirror of
https://github.com/element-hq/element-web
synced 2024-11-29 04:48:50 +03:00
Wait for login screen to appear in loading-test (#25276)
This commit is contained in:
parent
9e6467c684
commit
f00c742ebc
1 changed files with 5 additions and 4 deletions
|
@ -611,10 +611,6 @@ describe("loading:", function () {
|
||||||
httpBackend.when("GET", "/login").respond(200, { flows: [{ type: "m.login.password" }] });
|
httpBackend.when("GET", "/login").respond(200, { flows: [{ type: "m.login.password" }] });
|
||||||
httpBackend.flush(undefined); // We already would have tried the GET /login request
|
httpBackend.flush(undefined); // We already would have tried the GET /login request
|
||||||
|
|
||||||
// Give the component some time to finish processing the login flows before
|
|
||||||
// continuing.
|
|
||||||
await sleep(100);
|
|
||||||
|
|
||||||
httpBackend
|
httpBackend
|
||||||
.when("POST", "/login")
|
.when("POST", "/login")
|
||||||
.check(function (req) {
|
.check(function (req) {
|
||||||
|
@ -628,6 +624,11 @@ describe("loading:", function () {
|
||||||
device_id: "DEVICE_ID",
|
device_id: "DEVICE_ID",
|
||||||
access_token: "access_token",
|
access_token: "access_token",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Give the component some time to finish processing the login flows before continuing.
|
||||||
|
await waitFor(() => matrixChat?.container.querySelector("#mx_LoginForm_username"));
|
||||||
|
|
||||||
|
// Enter login details
|
||||||
fireEvent.change(matrixChat.container.querySelector("#mx_LoginForm_username")!, { target: { value: "user" } });
|
fireEvent.change(matrixChat.container.querySelector("#mx_LoginForm_username")!, { target: { value: "user" } });
|
||||||
fireEvent.change(matrixChat.container.querySelector("#mx_LoginForm_password")!, { target: { value: "pass" } });
|
fireEvent.change(matrixChat.container.querySelector("#mx_LoginForm_password")!, { target: { value: "pass" } });
|
||||||
fireEvent.click(screen.getByText("Sign in", { selector: ".mx_Login_submit" }));
|
fireEvent.click(screen.getByText("Sign in", { selector: ".mx_Login_submit" }));
|
||||||
|
|
Loading…
Reference in a new issue