Skip to content

Commit 3398496

Browse files
committed
Fixing test for metric_query
1 parent 258e5ef commit 3398496

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.test.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,4 @@ describe("The Metric Threshold Alert's getElasticsearchMetricQuery", () => {
6464
);
6565
});
6666
});
67-
68-
describe('when passed a timeframe of 1 hour', () => {
69-
const testTimeframe = {
70-
start: moment().subtract(1, 'hour').valueOf(),
71-
end: moment().valueOf(),
72-
};
73-
const searchBodyWithoutGroupBy = getElasticsearchMetricQuery(
74-
expressionParams,
75-
timefield,
76-
testTimeframe
77-
);
78-
const searchBodyWithGroupBy = getElasticsearchMetricQuery(
79-
expressionParams,
80-
timefield,
81-
testTimeframe,
82-
groupBy
83-
);
84-
test("generates 1 hour's worth of buckets", () => {
85-
// @ts-ignore
86-
expect(searchBodyWithoutGroupBy.aggs.aggregatedIntervals.date_range.ranges.length).toBe(60);
87-
expect(
88-
// @ts-ignore
89-
searchBodyWithGroupBy.aggs.groupings.aggs.aggregatedIntervals.date_range.ranges.length
90-
).toBe(60);
91-
});
92-
});
9367
});

0 commit comments

Comments
 (0)