Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Mar 19, 2020
1 parent c8af703 commit f852ae2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const alertInstances = new Map();

const services = {
callCluster(_: string, { body }: any) {
const metric = body.query.bool.filter[1].exists.field;
const metric = body.query.bool.filter[1]?.exists.field;
if (body.aggs.groupings) {
if (body.aggs.groupings.composite.after) {
return mocks.compositeEndResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ export const getElasticsearchMetricQuery = (
: [];

const parsedFilterQuery = getParsedFilterQuery(filterQuery);
const queryFilters = !isEmpty(parsedFilterQuery) ? [parsedFilterQuery] : [];

return {
query: {
bool: {
filter: [...rangeFilters, ...metricFieldFilters, ...queryFilters],
filter: [...rangeFilters, ...metricFieldFilters],
...parsedFilterQuery,
},
},
size: 0,
Expand Down

0 comments on commit f852ae2

Please sign in to comment.