Update loading-test.tsx

This commit is contained in:
Michael Telatynski 2023-09-06 18:14:38 +01:00 committed by GitHub
parent b0d5eb906f
commit f659c47a61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -273,7 +273,7 @@ describe("loading:", function () {
await waitForElementToBeRemoved(() => screen.queryAllByLabelText("Loading...")); await waitForElementToBeRemoved(() => screen.queryAllByLabelText("Loading..."));
// we expect a single <Login> component // we expect a single <Login> component
await screen.findByRole("main"); await screen.findByRole("main");
screen.getAllByText("Sign In"); screen.getAllByText("Sign in");
// the only outstanding request should be a GET /login // the only outstanding request should be a GET /login
// (in particular there should be no /register request for // (in particular there should be no /register request for
@ -378,7 +378,7 @@ describe("loading:", function () {
await awaitRoomView(matrixChat); await awaitRoomView(matrixChat);
await screen.findByLabelText("Spaces"); await screen.findByLabelText("Spaces");
expect(screen.queryAllByText("Sign In")).toHaveLength(0); expect(screen.queryAllByText("Sign in")).toHaveLength(0);
}); });
}); });
}); });
@ -544,7 +544,7 @@ describe("loading:", function () {
it("should give us a login page", async function () { it("should give us a login page", async function () {
// we expect a single <Login> component // we expect a single <Login> component
await screen.findByRole("main"); await screen.findByRole("main");
screen.getAllByText("Sign In"); screen.getAllByText("Sign in");
expect(windowLocation?.hash).toEqual("#/login"); expect(windowLocation?.hash).toEqual("#/login");
}); });
@ -631,7 +631,7 @@ describe("loading:", function () {
// Enter login details // 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" }));
return httpBackend return httpBackend
.flush(undefined) .flush(undefined)