Skip to content

Commit 3c77f44

Browse files
committed
add tests for RetailCalendar
1 parent 62aeeb3 commit 3c77f44

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

packages/cubejs-testing-drivers/src/tests/testQueries.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,6 +1833,60 @@ export function testQueries(type: string, { includeIncrementalSchemaSuite, exten
18331833
expect(response.rawData()).toMatchSnapshot();
18341834
});
18351835

1836+
execute('querying BigECommerce with Retail Calendar: totalCountRetailYearAgo', async () => {
1837+
const response = await client.load({
1838+
measures: [
1839+
'BigECommerce.count',
1840+
'BigECommerce.totalCountRetailYearAgo',
1841+
],
1842+
timeDimensions: [{
1843+
dimension: 'RetailCalendar.retail_date',
1844+
granularity: 'year',
1845+
dateRange: ['2020-02-02', '2021-02-01'],
1846+
}],
1847+
order: {
1848+
'RetailCalendar.retail_date': 'asc',
1849+
}
1850+
});
1851+
expect(response.rawData()).toMatchSnapshot();
1852+
});
1853+
1854+
execute('querying BigECommerce with Retail Calendar: totalCountRetailMonthAgo', async () => {
1855+
const response = await client.load({
1856+
measures: [
1857+
'BigECommerce.count',
1858+
'BigECommerce.totalCountRetailMonthAgo',
1859+
],
1860+
timeDimensions: [{
1861+
dimension: 'RetailCalendar.retail_date',
1862+
granularity: 'month',
1863+
dateRange: ['2020-02-02', '2021-02-01'],
1864+
}],
1865+
order: {
1866+
'RetailCalendar.retail_date': 'asc',
1867+
}
1868+
});
1869+
expect(response.rawData()).toMatchSnapshot();
1870+
});
1871+
1872+
execute('querying BigECommerce with Retail Calendar: totalCountRetailWeekAgo', async () => {
1873+
const response = await client.load({
1874+
measures: [
1875+
'BigECommerce.count',
1876+
'BigECommerce.totalCountRetailWeekAgo',
1877+
],
1878+
timeDimensions: [{
1879+
dimension: 'RetailCalendar.retail_date',
1880+
granularity: 'week',
1881+
dateRange: ['2020-02-02', '2021-03-07'],
1882+
}],
1883+
order: {
1884+
'RetailCalendar.retail_date': 'asc',
1885+
}
1886+
});
1887+
expect(response.rawData()).toMatchSnapshot();
1888+
});
1889+
18361890
execute('querying custom granularities ECommerce: count by half_year + no dimension', async () => {
18371891
const response = await client.load({
18381892
measures: [

0 commit comments

Comments
 (0)