diff --git a/src/queries.spec.ts b/src/queries.spec.ts index f09d760..16f6d28 100644 --- a/src/queries.spec.ts +++ b/src/queries.spec.ts @@ -21,11 +21,11 @@ JOIN blocks ON blocks.block_id = s.block_id WHERE (collection_name == '${collect test("getAggregate", () => { expect(getAggregate(new URLSearchParams({aggregate_function: 'count', collection_name}))) - .toBe(`SELECT count() FROM Sales WHERE (collection_name == '${collection_name}')`); + .toBe(`SELECT count() FROM Sales JOIN blocks ON blocks.block_id = Sales.block_id WHERE (collection_name == '${collection_name}')`); expect(getAggregate(new URLSearchParams({aggregate_function: 'count', aggregate_column: 'sale_id'}))) - .toBe(`SELECT count(sale_id) FROM Sales`); - + .toBe(`SELECT count(sale_id) FROM Sales JOIN blocks ON blocks.block_id = Sales.block_id`); + expect(getAggregate(new URLSearchParams({aggregate_function: 'max', aggregate_column: 'listing_price_amount'}))) - .toBe(`SELECT max(listing_price_amount) FROM Sales`); + .toBe(`SELECT max(listing_price_amount) FROM Sales JOIN blocks ON blocks.block_id = Sales.block_id`); }); \ No newline at end of file