mirror of
https://github.com/vector-im/element-web.git
synced 2025-11-29 06:21:20 +01:00
Fix flaky MatrixChat tests (#29739)
* test: fix flaky MatrixChat `should persist login credentials` test * test: fix flaky MatrixChat `should log and return to welcome page with correct error when login state is not found` test * test: fix flaky MatrixChat `should store clientId and issuer in session storage` test
This commit is contained in:
parent
475e449e81
commit
986be9c00d
@ -321,7 +321,7 @@ describe("<MatrixChat />", () => {
|
|||||||
await flushPromises();
|
await flushPromises();
|
||||||
const dialog = await screen.findByRole("dialog");
|
const dialog = await screen.findByRole("dialog");
|
||||||
|
|
||||||
expect(within(dialog).getByText(errorMessage)).toBeInTheDocument();
|
await waitFor(() => expect(within(dialog).getByText(errorMessage)).toBeInTheDocument());
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@ -487,17 +487,17 @@ describe("<MatrixChat />", () => {
|
|||||||
it("should persist login credentials", async () => {
|
it("should persist login credentials", async () => {
|
||||||
getComponent({ realQueryParams });
|
getComponent({ realQueryParams });
|
||||||
|
|
||||||
await waitFor(() => expect(localStorage.getItem("mx_hs_url")).toEqual(homeserverUrl));
|
await waitFor(() => expect(localStorage.getItem("mx_device_id")).toEqual(deviceId));
|
||||||
|
expect(localStorage.getItem("mx_hs_url")).toEqual(homeserverUrl);
|
||||||
expect(localStorage.getItem("mx_user_id")).toEqual(userId);
|
expect(localStorage.getItem("mx_user_id")).toEqual(userId);
|
||||||
expect(localStorage.getItem("mx_has_access_token")).toEqual("true");
|
expect(localStorage.getItem("mx_has_access_token")).toEqual("true");
|
||||||
expect(localStorage.getItem("mx_device_id")).toEqual(deviceId);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should store clientId and issuer in session storage", async () => {
|
it("should store clientId and issuer in session storage", async () => {
|
||||||
getComponent({ realQueryParams });
|
getComponent({ realQueryParams });
|
||||||
|
|
||||||
await waitFor(() => expect(localStorage.getItem("mx_oidc_client_id")).toEqual(clientId));
|
await waitFor(() => expect(localStorage.getItem("mx_oidc_client_id")).toEqual(clientId));
|
||||||
expect(localStorage.getItem("mx_oidc_token_issuer")).toEqual(issuer);
|
await waitFor(() => expect(localStorage.getItem("mx_oidc_token_issuer")).toEqual(issuer));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should set logged in and start MatrixClient", async () => {
|
it("should set logged in and start MatrixClient", async () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user