Address PR #1229 code review feedback
- ToolsScreen.fixtures.ts: replace empty `{}` schemas in query_database
params and post_request body with explicit `type` for consistency
- ToolControls WithSearch story: add play function that types "git" so
the story actually demonstrates filtering
- ResourcesScreen stories: comment expandUserProfileTemplate to document
the userId/readUserProfileState.uri coupling
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d5559b4ea6
commit
17d8532396
3 changed files with 13 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||||
import { fn } from "storybook/test";
|
import { fn, userEvent, within } from "storybook/test";
|
||||||
import { ToolControls } from "./ToolControls";
|
import { ToolControls } from "./ToolControls";
|
||||||
import { longToolList } from "../../screens/ToolsScreen/ToolsScreen.fixtures";
|
import { longToolList } from "../../screens/ToolsScreen/ToolsScreen.fixtures";
|
||||||
|
|
||||||
|
|
@ -33,6 +33,13 @@ export const WithSearch: Story = {
|
||||||
args: {
|
args: {
|
||||||
tools: longToolList,
|
tools: longToolList,
|
||||||
},
|
},
|
||||||
|
play: async ({ canvasElement }) => {
|
||||||
|
const canvas = within(canvasElement);
|
||||||
|
await userEvent.type(
|
||||||
|
await canvas.findByPlaceholderText("Search tools..."),
|
||||||
|
"git",
|
||||||
|
);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ListChanged: Story = {
|
export const ListChanged: Story = {
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,9 @@ async function clickByText(canvasElement: HTMLElement, label: string) {
|
||||||
await userEvent.click(await canvas.findByText(label));
|
await userEvent.click(await canvas.findByText(label));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The userId value typed below must match the `{userId}` segment in
|
||||||
|
// `readUserProfileState.uri` so the synthetic-resource fallback in
|
||||||
|
// ResourcesScreen matches and the preview panel renders.
|
||||||
async function expandUserProfileTemplate(canvasElement: HTMLElement) {
|
async function expandUserProfileTemplate(canvasElement: HTMLElement) {
|
||||||
const canvas = within(canvasElement);
|
const canvas = within(canvasElement);
|
||||||
await userEvent.click(await canvas.findByText("User Profile"));
|
await userEvent.click(await canvas.findByText("User Profile"));
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export const longToolList: Tool[] = [
|
||||||
params: {
|
params: {
|
||||||
type: "array",
|
type: "array",
|
||||||
description: "Positional bind parameters",
|
description: "Positional bind parameters",
|
||||||
items: {},
|
items: { type: "string" },
|
||||||
},
|
},
|
||||||
limit: { type: "number" },
|
limit: { type: "number" },
|
||||||
},
|
},
|
||||||
|
|
@ -269,7 +269,7 @@ export const longToolList: Tool[] = [
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
url: { type: "string" },
|
url: { type: "string" },
|
||||||
body: {},
|
body: { type: "object", description: "JSON request body" },
|
||||||
headers: { type: "object" },
|
headers: { type: "object" },
|
||||||
},
|
},
|
||||||
required: ["url", "body"],
|
required: ["url", "body"],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue