Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 60b8eaf

Browse files
committed
Add test for use case selection
1 parent 579d507 commit 60b8eaf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/components/structures/MatrixChat-test.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import * as Lifecycle from "../../../src/Lifecycle";
5555
import { SSO_HOMESERVER_URL_KEY, SSO_ID_SERVER_URL_KEY } from "../../../src/BasePlatform";
5656
import SettingsStore from "../../../src/settings/SettingsStore";
5757
import { SettingLevel } from "../../../src/settings/SettingLevel";
58-
import { MatrixClientPeg as peg } from "../../../src/MatrixClientPeg";
58+
import { MatrixClientPeg, MatrixClientPeg as peg } from "../../../src/MatrixClientPeg";
5959
import DMRoomMap from "../../../src/utils/DMRoomMap";
6060
import { ReleaseAnnouncementStore } from "../../../src/stores/ReleaseAnnouncementStore";
6161
import { DRAFT_LAST_CLEANUP_KEY } from "../../../src/DraftCleaner";
@@ -131,6 +131,7 @@ describe("<MatrixChat />", () => {
131131
getUserVerificationStatus: jest.fn().mockResolvedValue(new UserVerificationStatus(false, false, false)),
132132
getVersion: jest.fn().mockReturnValue("1"),
133133
}),
134+
bootstrapCrossSigning: jest.fn(),
134135
secretStorage: {
135136
isStored: jest.fn().mockReturnValue(null),
136137
},
@@ -1110,6 +1111,15 @@ describe("<MatrixChat />", () => {
11101111
// set up keys screen is rendered
11111112
expect(screen.getByText("Setting up keys")).toBeInTheDocument();
11121113
});
1114+
1115+
it("should go to use case selection if user just registered", async () => {
1116+
loginClient.doesServerSupportUnstableFeature.mockResolvedValue(true);
1117+
MatrixClientPeg.setJustRegisteredUserId(userId);
1118+
1119+
await getComponentAndLogin();
1120+
1121+
await expect(await screen.findByRole("heading", { name: "You're in", level: 1 })).toBeInTheDocument();
1122+
});
11131123
});
11141124
});
11151125

0 commit comments

Comments
 (0)