mirror of
https://github.com/element-hq/element-desktop
synced 2025-04-17 10:23:59 +02:00
Add tests for fix to getOidcCallbackUrl (#2248)
This commit is contained in:
parent
aabbb8772d
commit
4fe0384523
@ -11,16 +11,18 @@ import { platform } from "node:os";
|
|||||||
import { test, expect } from "../../element-desktop-test.js";
|
import { test, expect } from "../../element-desktop-test.js";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
interface ElectronPlatform {
|
||||||
|
getEventIndexingManager():
|
||||||
|
| {
|
||||||
|
supportsEventIndexing(): Promise<boolean>;
|
||||||
|
}
|
||||||
|
| undefined;
|
||||||
|
createPickleKey(userId: string, deviceId: string): Promise<string | null>;
|
||||||
|
}
|
||||||
|
|
||||||
interface Window {
|
interface Window {
|
||||||
mxPlatformPeg: {
|
mxPlatformPeg: {
|
||||||
get(): {
|
get(): ElectronPlatform;
|
||||||
getEventIndexingManager():
|
|
||||||
| {
|
|
||||||
supportsEventIndexing(): Promise<boolean>;
|
|
||||||
}
|
|
||||||
| undefined;
|
|
||||||
createPickleKey(userId: string, deviceId: string): Promise<string | null>;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
36
playwright/e2e/launch/oidc.spec.ts
Normal file
36
playwright/e2e/launch/oidc.spec.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2025 New Vector Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||||
|
Please see LICENSE files in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { test, expect } from "../../element-desktop-test.js";
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface ElectronPlatform {
|
||||||
|
getOidcCallbackUrl(): URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Window {
|
||||||
|
mxPlatformPeg: {
|
||||||
|
get(): ElectronPlatform;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
test.describe("OIDC Native", () => {
|
||||||
|
test.slow();
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
await page.locator(".mx_Welcome").waitFor();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("should use OIDC callback URL without authority component", async ({ page }) => {
|
||||||
|
await expect(
|
||||||
|
page.evaluate<string>(() => {
|
||||||
|
return window.mxPlatformPeg.get().getOidcCallbackUrl().toString();
|
||||||
|
}),
|
||||||
|
).resolves.toBe("io.element.desktop:/vector/webapp/");
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user