Skip to content
This repository was archived by the owner on Dec 11, 2022. It is now read-only.

Commit 94b2341

Browse files
committed
Added a test where, 1800 seconds divided in 1742 (default maxDataPoints shoult not result in 1 s groups, since 1800 > 1742
1 parent a1f5fba commit 94b2341

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/specs/bigquery_query.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,15 @@ describe("BigQueryQuery", () => {
331331
where: []
332332
};
333333
const query = new BigQueryQuery(target, templateSrv);
334+
const time = {
335+
from: { _d: 1588147101364 },
336+
to: { _d: 1588148901364 }
337+
};
338+
query.templateSrv.timeRange = time;
339+
340+
expect(query.getIntervalStr("auto", undefined, { maxDataPoints: 1742 })).toBe(
341+
"TIMESTAMP_SECONDS(DIV(UNIX_SECONDS(`my_data`), 2) * 2) AS time"
342+
);
334343
expect(query.getIntervalStr("1s", "0", null)).toBe(
335344
"TIMESTAMP_SECONDS(DIV(UNIX_SECONDS(`my_data`), 1) * 1) AS time"
336345
);

0 commit comments

Comments
 (0)