Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline (Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/* packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { shouldOpenInAppPopup } from "./window-open.js";
|
|
|
|
const appOrigin = "https://rakazo.example.com";
|
|
|
|
describe("desktop child windows", () => {
|
|
it("keeps same-origin app routes in Electron", () => {
|
|
expect(shouldOpenInAppPopup(appOrigin, `${appOrigin}/mcp/oauth/callback`, "_blank")).toBe(true);
|
|
});
|
|
|
|
it("opens ordinary external links outside Electron", () => {
|
|
expect(
|
|
shouldOpenInAppPopup(appOrigin, "https://github.com/elie222/rakazo/pull/395", "_blank"),
|
|
).toBe(false);
|
|
});
|
|
|
|
it.each([
|
|
"rakazo-model-oauth",
|
|
"rakazo-mcp-oauth",
|
|
"rakazo-app-connect",
|
|
"rakazo-plugin-connect",
|
|
])("keeps the intentional %s flow in an Electron popup", (frameName) => {
|
|
expect(
|
|
shouldOpenInAppPopup(appOrigin, "https://provider.example.com/authorize", frameName),
|
|
).toBe(true);
|
|
});
|
|
|
|
it("rejects malformed URLs and non-HTTPS third-party targets", () => {
|
|
expect(shouldOpenInAppPopup(appOrigin, "not a url", "rakazo-model-oauth")).toBe(false);
|
|
expect(
|
|
shouldOpenInAppPopup(appOrigin, "http://provider.example.com", "rakazo-model-oauth"),
|
|
).toBe(false);
|
|
});
|
|
});
|