Skip to content

Commit f7dc06b

Browse files
committed
Add tests
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 80997c1 commit f7dc06b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/unit-tests/vector/platform/ElectronPlatform-test.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("ElectronPlatform", () => {
3434
initialise: jest.fn().mockResolvedValue({
3535
protocol: "io.element.desktop",
3636
sessionId: "session-id",
37-
config: {},
37+
config: { _config: true },
3838
}),
3939
};
4040

@@ -69,6 +69,17 @@ describe("ElectronPlatform", () => {
6969
expect(rageshake.flush).toHaveBeenCalled();
7070
});
7171

72+
it("should load config", async () => {
73+
const platform = new ElectronPlatform();
74+
await expect(platform.getConfig()).resolves.toEqual({ _config: true });
75+
});
76+
77+
it("should return oidc client state as expected", async () => {
78+
const platform = new ElectronPlatform();
79+
await platform.getConfig();
80+
expect(platform.getOidcClientState()).toMatchInlineSnapshot(`":element-desktop-ssoid:session-id"`);
81+
});
82+
7283
it("dispatches view settings action on preferences event", () => {
7384
new ElectronPlatform();
7485
const [event, handler] = getElectronEventHandlerCall("preferences")!;
@@ -292,7 +303,7 @@ describe("ElectronPlatform", () => {
292303
});
293304
});
294305

295-
describe("breacrumbs", () => {
306+
describe("breadcrumbs", () => {
296307
it("should send breadcrumb updates over the IPC", () => {
297308
const spy = jest.spyOn(BreadcrumbsStore.instance, "on");
298309
new ElectronPlatform();

0 commit comments

Comments
 (0)