mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-08-31 02:41:44 +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);
|
||||
});
|
||||
|
||||
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 () => {
|
||||
|
||||
Reference in New Issue
Block a user