Skip to content

Commit da6514d

Browse files
miga-heygenclaude
andcommitted
fix(studio): update WebMCP test for polyfill fallback
The "registers nothing when the browser has no WebMCP" test asserted that document.modelContext was absent after mount. Since #3514 added the @mcp-b/global polyfill fallback, the hook now installs document.modelContext even when the browser has no native support — that is the polyfill's job. The real assertion is that mounting does not throw, which still holds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 10a9068 commit da6514d

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)