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 <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-02 11:30:41 -05:00
1 parent fb34251942
commit a88448f778
2 files changed
+7 -3

No files matched your search

+2 -2
View File
@@ -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);
@@ -10,7 +10,11 @@ const meta = {
export default meta;
type Story = StoryObj<typeof meta>;
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();