From a033d031b5d7b116ca77cc0a26940b9e039cb0e7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 22 Apr 2024 14:33:21 +0100 Subject: [PATCH] Update test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/app-tests/loading-test.tsx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/test/app-tests/loading-test.tsx b/test/app-tests/loading-test.tsx index fffdd95945..486b871d78 100644 --- a/test/app-tests/loading-test.tsx +++ b/test/app-tests/loading-test.tsx @@ -336,22 +336,19 @@ describe("loading:", function () { }); }); - it("shows a home page by default if we have no joined rooms", function () { + it("shows a home page by default if we have no joined rooms", async () => { localStorage.removeItem("mx_last_room_id"); loadApp(); - return awaitLoggedIn(matrixChat!) - .then(() => { - // we are logged in - let the sync complete - return expectAndAwaitSync(); - }) - .then(() => { - // once the sync completes, we should have a home page - httpBackend.verifyNoOutstandingExpectation(); - expect(matrixChat?.container.querySelector(".mx_HomePage")).toBeTruthy(); - expect(windowLocation?.hash).toEqual("#/home"); - }); + await awaitLoggedIn(matrixChat!); + // we are logged in - let the sync complete + await expectAndAwaitSync(); + // once the sync completes, we should have a home page + httpBackend.verifyNoOutstandingExpectation(); + await waitFor(() => matrixChat?.container.querySelector(".mx_HomePage")); + expect(matrixChat?.container.querySelector(".mx_HomePage")).toBeTruthy(); + expect(windowLocation?.hash).toEqual("#/home"); }); it("shows a room view if we followed a room link", function () {