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>
This commit is contained in:
miga-heygen
2026-08-28 03:34:28 +00:00
co-authored by Claude Opus 4.6
parent 10a90688e7
commit da6514d458
@@ -149,16 +149,16 @@ describe("useStudioAgentTools", () => {
expect(signal?.aborted).toBe(true);
});
it("registers nothing when the browser has no WebMCP", async () => {
it("boots cleanly when the browser has no native WebMCP", async () => {
removeModelContext();
await act(async () => {
mountTools({ getSnapshot: () => snapshot() });
});
// The assertion is that mounting did not throw; a browser without the API
// must still boot Studio.
expect(document).not.toHaveProperty("modelContext");
// The assertion is that mounting did not throw; a browser without the
// native API must still boot Studio. The polyfill may install
// document.modelContext as a fallback — that is expected.
});
it("registers nothing when the preference is turned off", async () => {