Skip to content

Commit e1fa045

Browse files
bloveclaude
andauthored
test(examples-chat): add aimock fixture for contact-form welcome chip (#451)
`lifecycle.spec.ts:61` ('selecting a welcome suggestion submits and clears welcome state') clicks the 'Demo: render a contact form' welcome chip, which sends the full chip value as the LLM prompt: 'Show me a contact form with fields for name, email address, subject, and a multi-line message, plus a Send button.' No fixture matched this prompt, so the test's fire-and-forget click left 4 'No fixture matched' / 'Background run failed' tracebacks in the langgraph backend log every CI run since the chip was added. The test itself passed because it didn't await the assistant response. Add a fixture matching the substring 'contact form' (aimock's userMessage match is includes-based) that returns a render_a2ui_surface tool call building the contact form spec the prompt asked for. Verified locally: lifecycle:61 now logs 'Background run succeeded' instead of the 404 cascade. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 556492b commit e1fa045

1 file changed

Lines changed: 119 additions & 0 deletions

File tree

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"fixtures": [
3+
{
4+
"match": {
5+
"userMessage": "contact form"
6+
},
7+
"response": {
8+
"toolCalls": [
9+
{
10+
"name": "render_a2ui_surface",
11+
"arguments": {
12+
"envelopes": [
13+
{
14+
"surfaceUpdate": {
15+
"surfaceId": "contact-form",
16+
"components": [
17+
{
18+
"id": "root",
19+
"component": {
20+
"Column": {
21+
"children": {
22+
"explicitList": [
23+
"form-title",
24+
"name-field",
25+
"email-field",
26+
"subject-field",
27+
"message-field",
28+
"send-button"
29+
]
30+
},
31+
"alignment": "start"
32+
}
33+
}
34+
},
35+
{
36+
"id": "form-title",
37+
"component": {
38+
"Text": {
39+
"text": { "literalString": "Contact Us" },
40+
"usageHint": "h1"
41+
}
42+
}
43+
},
44+
{
45+
"id": "name-field",
46+
"component": {
47+
"TextField": {
48+
"label": { "literalString": "Name" },
49+
"text": { "literalString": "" },
50+
"textFieldType": "shortText"
51+
}
52+
}
53+
},
54+
{
55+
"id": "email-field",
56+
"component": {
57+
"TextField": {
58+
"label": { "literalString": "Email address" },
59+
"text": { "literalString": "" },
60+
"textFieldType": "shortText"
61+
}
62+
}
63+
},
64+
{
65+
"id": "subject-field",
66+
"component": {
67+
"TextField": {
68+
"label": { "literalString": "Subject" },
69+
"text": { "literalString": "" },
70+
"textFieldType": "shortText"
71+
}
72+
}
73+
},
74+
{
75+
"id": "message-field",
76+
"component": {
77+
"TextField": {
78+
"label": { "literalString": "Message" },
79+
"text": { "literalString": "" },
80+
"textFieldType": "longText"
81+
}
82+
}
83+
},
84+
{
85+
"id": "send-button",
86+
"component": {
87+
"Button": {
88+
"child": "send-text",
89+
"action": {
90+
"name": "submit_contact"
91+
}
92+
}
93+
}
94+
},
95+
{
96+
"id": "send-text",
97+
"component": {
98+
"Text": {
99+
"text": { "literalString": "Send" }
100+
}
101+
}
102+
}
103+
]
104+
}
105+
},
106+
{
107+
"beginRendering": {
108+
"surfaceId": "contact-form",
109+
"root": "root"
110+
}
111+
}
112+
]
113+
}
114+
}
115+
]
116+
}
117+
}
118+
]
119+
}

0 commit comments

Comments
 (0)