MCPcopy Create free account
hub / github.com/TanStack/ai / renderAndCapture

Function renderAndCapture

packages/ai-react/tests/mcp-apps.test.tsx:51–65  ·  view source on GitHub ↗

Render the component and return the props captured from AppRenderer. The * required handlers are read off the captured props with their real types.

(props: {
  bridge?: McpAppBridge
  toolInput?: Record<string, unknown>
})

Source from the content-addressed store, hash-verified

49/** Render the component and return the props captured from AppRenderer. The
50 * required handlers are read off the captured props with their real types. */
51function renderAndCapture(props: {
52 bridge?: McpAppBridge
53 toolInput?: Record<string, unknown>
54}) {
55 capturedProps = {}
56 render(
57 <MCPAppResource
58 part={fakePart}
59 bridge={props.bridge}
60 sandbox={fakeSandbox}
61 toolInput={props.toolInput}
62 />,
63 )
64 return capturedProps
65}
66
67/** The text of the first content block, asserting it is a text block. */
68function firstText(result: CallToolResult): string {

Callers 1

mcp-apps.test.tsxFile · 0.85

Calls 1

renderFunction · 0.85

Tested by

no test coverage detected