From 8b2f40f5f643be315ae78d95a520db09af08401a Mon Sep 17 00:00:00 2001 From: shrey150 Date: Mon, 2 Mar 2026 02:02:03 -0800 Subject: [PATCH] fix(browser): update existing tests for ws/wss protocol support Two pre-existing tests still expected ws:// URLs to be rejected by parseHttpUrl, which now accepts them. Switch the invalid-protocol fixture to ftp:// and tighten the assertion to match the full "must be http(s) or ws(s)" error message. Co-Authored-By: Claude Opus 4.6 --- src/browser/config.test.ts | 4 +++- .../server.post-tabs-open-profile-unknown-returns-404.test.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/browser/config.test.ts b/src/browser/config.test.ts index ec1c40cd66e..5fa1488a22d 100644 --- a/src/browser/config.test.ts +++ b/src/browser/config.test.ts @@ -166,7 +166,9 @@ describe("browser config", () => { }); it("rejects unsupported protocols", () => { - expect(() => resolveBrowserConfig({ cdpUrl: "ws://127.0.0.1:18791" })).toThrow(/must be http/i); + expect(() => resolveBrowserConfig({ cdpUrl: "ftp://127.0.0.1:18791" })).toThrow( + "must be http(s) or ws(s)", + ); }); it("does not add the built-in chrome extension profile if the derived relay port is already used", () => { diff --git a/src/browser/server.post-tabs-open-profile-unknown-returns-404.test.ts b/src/browser/server.post-tabs-open-profile-unknown-returns-404.test.ts index 26de7ecccac..b65c74319a3 100644 --- a/src/browser/server.post-tabs-open-profile-unknown-returns-404.test.ts +++ b/src/browser/server.post-tabs-open-profile-unknown-returns-404.test.ts @@ -110,7 +110,7 @@ describe("profile CRUD endpoints", () => { const createBadRemote = await realFetch(`${base}/profiles/create`, { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ name: "badremote", cdpUrl: "ws://bad" }), + body: JSON.stringify({ name: "badremote", cdpUrl: "ftp://bad" }), }); expect(createBadRemote.status).toBe(400); const createBadRemoteBody = (await createBadRemote.json()) as { error: string };