Skip to content
Snippets Groups Projects
Unverified Commit dd4035c3 authored by Anton Kulyk's avatar Anton Kulyk Committed by GitHub
Browse files

Fix system time in `parameters/utils/mbql` tests (#31123)

parent 609bd7f6
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,14 @@ describe("parameters/utils/mbql", () => {
});
describe("dateParameterValueToMBQL", () => {
const date = () =>
moment().utc().hours(0).minutes(0).seconds(0).milliseconds(0);
beforeEach(() => {
jest.useFakeTimers();
jest.setSystemTime(date().date(1).month(1).toDate());
});
it("should parse past30days", () => {
expect(dateParameterValueToMBQL("past30days", null)).toEqual([
"time-interval",
......@@ -166,9 +174,6 @@ describe("parameters/utils/mbql", () => {
date().day(5).format("YYYY-MM-DD"),
]);
});
const date = () =>
moment().utc().hours(0).minutes(0).seconds(0).milliseconds(0);
});
describe("stringParameterValueToMBQL", () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment