Skip to content

Commit 63aef19

Browse files
committed
feat(showcase/langgraph-python): add testids and pills required by d5 probes
Adds production-code testids needed by the Phase-2B genuine D5 probes: - frontend-tools/background.tsx: data-testid='frontend-tools-background' + data-background-value mirror so the probe can read the live gradient off the DOM without computing styles. - declarative-gen-ui/a2ui/renderers.tsx: data-testid for Card, StatusBadge, Metric, PieChart, BarChart so per-pill probes can assert the expected catalog component painted. - a2ui-fixed-schema/a2ui/renderers.tsx: data-testid='a2ui-fixed-card' on the Card override so the fixed-schema component-tree mount is observable without keyword-matching the transcript. Each cell's Layer 1 spec is already green; this is purely additive — no spec rewrites.
1 parent 265c156 commit 63aef19

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

showcase/integrations/langgraph-python/src/app/demos/a2ui-fixed-schema/a2ui/renderers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const renderers: CatalogRenderers<Definitions> = {
3333
* Column adds the vertical spacing.
3434
*/
3535
Card: ({ props, children }) => (
36-
<Card className="w-full max-w-md p-5">
36+
<Card className="w-full max-w-md p-5" data-testid="a2ui-fixed-card">
3737
{props.child ? children(props.child) : null}
3838
</Card>
3939
),

showcase/integrations/langgraph-python/src/app/demos/declarative-gen-ui/a2ui/renderers.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function AnimatedBar(props: any) {
163163
// @region[renderers-react]
164164
export const myRenderers: CatalogRenderers<MyDefinitions> = {
165165
Card: ({ props, children }) => (
166-
<Card className="min-w-[260px]">
166+
<Card className="min-w-[260px]" data-testid="declarative-card">
167167
<CardHeader>
168168
<CardTitle>{props.title}</CardTitle>
169169
{props.subtitle && <CardDescription>{props.subtitle}</CardDescription>}
@@ -177,7 +177,12 @@ export const myRenderers: CatalogRenderers<MyDefinitions> = {
177177
),
178178

179179
StatusBadge: ({ props }) => (
180-
<Badge variant={props.variant ?? "info"}>{props.text}</Badge>
180+
<Badge
181+
variant={props.variant ?? "info"}
182+
data-testid="declarative-status-badge"
183+
>
184+
{props.text}
185+
</Badge>
181186
),
182187

183188
Metric: ({ props }) => {
@@ -190,7 +195,7 @@ export const myRenderers: CatalogRenderers<MyDefinitions> = {
190195
? "text-rose-600"
191196
: "text-[var(--foreground)]";
192197
return (
193-
<div className="flex flex-col gap-1">
198+
<div data-testid="declarative-metric" className="flex flex-col gap-1">
194199
<div className="text-xs font-medium uppercase tracking-wider text-[var(--muted-foreground)]">
195200
{props.label}
196201
</div>
@@ -234,7 +239,10 @@ export const myRenderers: CatalogRenderers<MyDefinitions> = {
234239
const total = safeData.reduce((sum, d) => sum + (Number(d.value) || 0), 0);
235240

236241
return (
237-
<Card className="mx-auto max-w-[520px] overflow-hidden">
242+
<Card
243+
className="mx-auto max-w-[520px] overflow-hidden"
244+
data-testid="declarative-pie-chart"
245+
>
238246
<CardHeader>
239247
<CardTitle>{props.title}</CardTitle>
240248
<CardDescription>{props.description}</CardDescription>
@@ -290,7 +298,10 @@ export const myRenderers: CatalogRenderers<MyDefinitions> = {
290298
const safeData = Array.isArray(data) ? data : [];
291299

292300
return (
293-
<Card className="mx-auto max-w-[640px] overflow-hidden">
301+
<Card
302+
className="mx-auto max-w-[640px] overflow-hidden"
303+
data-testid="declarative-bar-chart"
304+
>
294305
{/* Scoped keyframe — no globals.css needed */}
295306
<style>{`
296307
@keyframes barSlideIn {

showcase/integrations/langgraph-python/src/app/demos/frontend-tools/background.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export function Background({
1515
}) {
1616
return (
1717
<div
18+
data-testid="frontend-tools-background"
19+
data-background-value={background}
1820
className="relative h-screen w-full overflow-hidden transition-[background] duration-700"
1921
style={{ background }}
2022
>

0 commit comments

Comments
 (0)