Skip to content

Commit af1cb1c

Browse files
fix(studio): update WebMCP test for polyfill fallback (#3532)
## Summary - The `useStudioAgentTools` test "registers nothing when the browser has no WebMCP" asserted `document.modelContext` was absent after mount - Since #3514 added the `@mcp-b/global` polyfill, the hook installs `document.modelContext` even without native browser support — that's the polyfill's purpose - Updated the test to verify that mounting doesn't throw (the real contract), without asserting polyfill absence This fixes the `CI / Test` failure on `main`. ## Other main CI failures (not ours) - **Docs / Validate docs** — `npm error notarget No matching version found for mint@4.2.837` (docs tool dependency) - **Windows / Tests on windows-latest** — `ECONNREFUSED ::1:3000` (Windows network test infra) - **regression** — cancelled, not failing ## Test plan - [x] All 9 `useStudioAgentTools` tests pass with `NODE_ENV=development` - [x] Pre-commit hooks: lint, format, fallow, typecheck all green — Miga 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents 10a9068 + da6514d commit af1cb1c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/studio/src/webmcp/useStudioAgentTools.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,16 @@ describe("useStudioAgentTools", () => {
149149
expect(signal?.aborted).toBe(true);
150150
});
151151

152-
it("registers nothing when the browser has no WebMCP", async () => {
152+
it("boots cleanly when the browser has no native WebMCP", async () => {
153153
removeModelContext();
154154

155155
await act(async () => {
156156
mountTools({ getSnapshot: () => snapshot() });
157157
});
158158

159-
// The assertion is that mounting did not throw; a browser without the API
160-
// must still boot Studio.
161-
expect(document).not.toHaveProperty("modelContext");
159+
// The assertion is that mounting did not throw; a browser without the
160+
// native API must still boot Studio. The polyfill may install
161+
// document.modelContext as a fallback — that is expected.
162162
});
163163

164164
it("registers nothing when the preference is turned off", async () => {

0 commit comments

Comments
 (0)