Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy committed Apr 22, 2024
1 parent fd49787 commit a033d03
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions test/app-tests/loading-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit a033d03

Please sign in to comment.