From a88448f7786d8258e07ec6555bb9ef3ae53cd6af Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 2 Oct 2026 11:30:41 -0500 Subject: [PATCH] Use canonical settings defaults in MCP stories Keep the surrounding experimental settings accurate and assert that the native runner retains its default while MCP starts disabled. Co-Authored-By: Paperclip --- ui/storybook/fixtures/publicMcp.ts | 4 ++-- ui/storybook/stories/public-mcp-setting.stories.tsx | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/storybook/fixtures/publicMcp.ts b/ui/storybook/fixtures/publicMcp.ts index 2a065b17176..a0f2d146227 100644 --- a/ui/storybook/fixtures/publicMcp.ts +++ b/ui/storybook/fixtures/publicMcp.ts @@ -1,4 +1,4 @@ -import type { McpConnection, McpConnectionRequest } from "@paperclipai/shared"; +import { instanceExperimentalSettingsSchema, type InstanceExperimentalSettingsWithManaged, type McpConnection, type McpConnectionRequest } from "@paperclipai/shared"; import { fn } from "storybook/test"; export const consentSubmission = fn(); @@ -31,7 +31,7 @@ export function installPublicMcpFixture(fixture: PublicMcpFixture = {}) { consentSubmission.mockClear(); const original = window.fetch; let rows = fixture.empty ? [] : connections.map(row => ({ ...row, revokedAt: fixture.revoked ? "2020-01-02T00:00:00Z" : null })); - let settings = { enablePublicMcp: Boolean(fixture.enabled), managedKeys: fixture.managed ? { enablePublicMcp: { managed: true, managedBy: "paperclip-cloud" } } : {} }; + let settings: InstanceExperimentalSettingsWithManaged = { ...instanceExperimentalSettingsSchema.parse({}), enablePublicMcp: Boolean(fixture.enabled), managedKeys: fixture.managed ? { enablePublicMcp: { managed: true, managedBy: "paperclip-cloud" } } : {} }; const error = (message: string, status = 503) => Response.json({ error: message }, { status }); window.fetch = async (input, init) => { const url = new URL(typeof input === "string" ? input : input instanceof URL ? input.href : input.url, location.origin); diff --git a/ui/storybook/stories/public-mcp-setting.stories.tsx b/ui/storybook/stories/public-mcp-setting.stories.tsx index 41b2d0341b1..a6cb3716cc1 100644 --- a/ui/storybook/stories/public-mcp-setting.stories.tsx +++ b/ui/storybook/stories/public-mcp-setting.stories.tsx @@ -10,7 +10,11 @@ const meta = { export default meta; type Story = StoryObj; const name = "Toggle assistant connections experimental setting"; -export const DisabledByDefault: Story = {}; +export const DisabledByDefault: Story = { play: async ({ canvasElement }) => { + const c = within(canvasElement); + await expect(await c.findByRole("switch", { name })).not.toBeChecked(); + await expect(c.getByRole("switch", { name: "Toggle Paperclip Runner experimental setting" })).toBeChecked(); +} }; export const Enabled: Story = { parameters: { fixture: { enabled: true } } }; export const ManagedByCloud: Story = { parameters: { fixture: { enabled: true, managed: true } }, play: async ({ canvasElement }) => { await expect(await within(canvasElement).findByRole("switch", { name })).toBeDisabled();