mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
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:
co-authored by
Claude Opus 4.6
parent
10a90688e7
commit
da6514d458
@@ -149,16 +149,16 @@ describe("useStudioAgentTools", () => {
|
|||||||
expect(signal?.aborted).toBe(true);
|
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();
|
removeModelContext();
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
mountTools({ getSnapshot: () => snapshot() });
|
mountTools({ getSnapshot: () => snapshot() });
|
||||||
});
|
});
|
||||||
|
|
||||||
// The assertion is that mounting did not throw; a browser without the API
|
// The assertion is that mounting did not throw; a browser without the
|
||||||
// must still boot Studio.
|
// native API must still boot Studio. The polyfill may install
|
||||||
expect(document).not.toHaveProperty("modelContext");
|
// document.modelContext as a fallback — that is expected.
|
||||||
});
|
});
|
||||||
|
|
||||||
it("registers nothing when the preference is turned off", async () => {
|
it("registers nothing when the preference is turned off", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user