Skip to content

Commit c546fda

Browse files
os-zhuangclaude
andcommitted
test(spec): cover widget condition in strict mirror + refresh api-surface
The strict SolutionBlueprintStrictSchema makes every widget key required-present (nullable for optionality), so the new `condition` slot must appear in the strict widget fixtures — one null, one a real {field,op,value}. Regenerate api-surface.json to register the new BlueprintWidgetCondition export. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 90dcf0a commit c546fda

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

packages/spec/api-surface.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,6 +1731,8 @@
17311731
"BlueprintSeedSchema (const)",
17321732
"BlueprintView (type)",
17331733
"BlueprintViewSchema (const)",
1734+
"BlueprintWidgetCondition (type)",
1735+
"BlueprintWidgetConditionSchema (const)",
17341736
"CodeContentSchema (const)",
17351737
"ConversationAnalytics (type)",
17361738
"ConversationAnalyticsSchema (const)",

packages/spec/src/ai/solution-blueprint.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,22 +224,23 @@ describe('SolutionBlueprintStrictSchema (OpenAI strict mirror)', () => {
224224
expect('seedData' in SolutionBlueprintStrictSchema.shape).toBe(false);
225225
});
226226

227-
it('accepts a dashboard widget carrying the (nullable) measure + groupBy keys', () => {
227+
it('accepts a dashboard widget carrying the (nullable) measure + groupBy + condition keys', () => {
228228
const parsed = SolutionBlueprintStrictSchema.parse({
229229
...strictBp,
230230
dashboards: [
231231
{
232232
name: 'overview',
233233
label: null,
234234
widgets: [
235-
{ id: 'revenue', title: 'Total revenue', object: 'project', chart: 'metric', measure: 'amount', groupBy: null },
236-
{ id: 'w2', title: null, object: null, chart: null, measure: null, groupBy: null },
235+
{ id: 'revenue', title: 'Total revenue', object: 'project', chart: 'metric', measure: 'amount', groupBy: null, condition: null },
236+
{ id: 'low_stock', title: 'Low stock', object: 'project', chart: 'table', measure: null, groupBy: null, condition: { field: 'qty', op: 'lt', value: 10 } },
237237
],
238238
},
239239
],
240240
});
241241
expect(parsed.dashboards?.[0].widgets?.[0]).toMatchObject({ measure: 'amount', groupBy: null });
242-
expect(parsed.dashboards?.[0].widgets?.[1].measure).toBeNull();
242+
expect(parsed.dashboards?.[0].widgets?.[0].condition).toBeNull();
243+
expect(parsed.dashboards?.[0].widgets?.[1].condition).toMatchObject({ field: 'qty', op: 'lt', value: 10 });
243244
});
244245

245246
it('requires the (nullable) measure + groupBy widget keys to be present (OpenAI strict)', () => {

0 commit comments

Comments
 (0)