Skip to content

Commit

Permalink
Updated queries spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelotfr committed Nov 1, 2023
1 parent 070c74f commit f277d45
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/queries.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
});

0 comments on commit f277d45

Please sign in to comment.