Skip to content

Commit

Permalink
Port over changes from PR on master
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipb committed Jul 29, 2021
1 parent 11bee09 commit 4de206c
Showing 1 changed file with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,4 @@ describe("The Metric Threshold Alert's getElasticsearchMetricQuery", () => {
});
});

describe('handles time', () => {
const end = new Date('2020-07-08T22:07:27.235Z').valueOf();
const timerange = {
end,
start: end - 5 * 60 * 1000,
};
const searchBody = getElasticsearchMetricQuery(
expressionParams,
timefield,
undefined,
undefined,
timerange
);
test('by rounding timestamps to the nearest timeUnit', () => {
const rangeFilter = searchBody.query.bool.filter.find((filter) =>
filter.hasOwnProperty('range')
)?.range[timefield];
expect(rangeFilter?.lte).toBe(1594246020000);
expect(rangeFilter?.gte).toBe(1594245720000);
});
});
});

0 comments on commit 4de206c

Please sign in to comment.