diff --git a/packages/objectql/src/engine-count-read-filter.test.ts b/packages/objectql/src/engine-count-read-filter.test.ts index 0809aa567e..47997d74b9 100644 --- a/packages/objectql/src/engine-count-read-filter.test.ts +++ b/packages/objectql/src/engine-count-read-filter.test.ts @@ -133,12 +133,15 @@ describe('engine read scoping — count/aggregate honor injected filters (#2737) await ql.aggregate('note', { where: { title: 'x' }, groupBy: ['owner'], - aggregations: [{ func: 'count', field: 'id', alias: 'n' }], - } as any); + aggregations: [{ function: 'count', field: 'id', alias: 'n' }], + }); expect(seen.aggregateAst?.where).toEqual({ $and: [{ title: 'x' }, { owner: 'me' }] }); // groupBy/aggregations survive on the same ast. expect(seen.aggregateAst?.groupBy).toEqual(['owner']); + expect(seen.aggregateAst?.aggregations).toEqual([ + { function: 'count', field: 'id', alias: 'n' }, + ]); }); it('count() and find() see the SAME scoped where (total matches records)', async () => { diff --git a/packages/objectql/src/engine-filter-tokens.test.ts b/packages/objectql/src/engine-filter-tokens.test.ts index c3e85c38e9..15730be7a6 100644 --- a/packages/objectql/src/engine-filter-tokens.test.ts +++ b/packages/objectql/src/engine-filter-tokens.test.ts @@ -160,12 +160,15 @@ describe('engine filter placeholders (framework#3582)', () => { await ql.aggregate('deal', { where: { close_date: { $gte: '{current_year_start}' } }, groupBy: ['owner'], - aggregations: [{ func: 'count', field: 'id', alias: 'n' }], + aggregations: [{ function: 'count', field: 'id', alias: 'n' }], context: CTX, - } as any); + }); expect(seen.aggregateAst?.where).toEqual({ close_date: { $gte: THIS_YEAR_START } }); expect(seen.aggregateAst?.groupBy).toEqual(['owner']); + expect(seen.aggregateAst?.aggregations).toEqual([ + { function: 'count', field: 'id', alias: 'n' }, + ]); }); it('throws on an unknown placeholder instead of matching nothing', async () => { diff --git a/scripts/query-options-erasure-baseline.json b/scripts/query-options-erasure-baseline.json index 89be7743ab..c7d801350e 100644 --- a/scripts/query-options-erasure-baseline.json +++ b/scripts/query-options-erasure-baseline.json @@ -50,6 +50,6 @@ "packages/services/service-settings/src/settings-service.ts": 2 }, "testSurface": { - "sites": 242 + "sites": 240 } }