Skip to content

Commit 42c89af

Browse files
committed
test(dogfood): read the refusal from the ADR-0112 error envelope
Claude-Session: https://claude.ai/code/session_016WV4cyTehJsfYGVMzcXLJD Co-authored-by: Claude <noreply@anthropic.com>
1 parent 017d0bf commit 42c89af

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/qa/dogfood/test/analytics-formula-group-refusal.dogfood.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ describe('dogfood: a plain group over a formula field is refused alike on the qu
4242
it(`${door}: a dimension over the formula → 400 INVALID_FIELD at groupBy.0, with the store-the-value remedy`, async () => {
4343
const res = await ask(door, 'budget_remaining');
4444
expect(res.status, JSON.stringify(res.body)).toBe(400);
45-
expect(res.body.code).toBe('INVALID_FIELD');
46-
const message = String(res.body.message ?? res.body.error);
45+
// The ADR-0112 envelope: `{ success: false, error: { code, message, … } }`.
46+
expect(res.body.error?.code, JSON.stringify(res.body)).toBe('INVALID_FIELD');
47+
const message = String(res.body.error?.message);
4748
expect(message).toContain(
4849
`aggregate('${CUBE}'): groupBy.0 groups by 'budget_remaining', but 'budget_remaining' is a formula field`,
4950
);
@@ -59,6 +60,7 @@ describe('dogfood: a plain group over a formula field is refused alike on the qu
5960
it('the query and the dry run give one refusal, word for word', async () => {
6061
const query = await ask('/analytics/query', 'budget_remaining');
6162
const sql = await ask('/analytics/sql', 'budget_remaining');
62-
expect(sql.body).toEqual(query.body);
63+
expect(sql.status).toBe(400);
64+
expect(sql.body.error).toEqual(query.body.error);
6365
});
6466
});

0 commit comments

Comments
 (0)