Skip to content

Commit

Permalink
Removed optional parameter and fixed tests to operate with it _not_ o…
Browse files Browse the repository at this point in the history
…ptional
  • Loading branch information
FrankHassanabad committed Jun 4, 2021
1 parent f68ae9b commit b301d84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface BuildEventsSearchQuery {
index: string[];
from: string;
to: string;
filter?: estypes.QueryContainer;
filter: estypes.QueryContainer;
size: number;
sortOrder?: SortOrderOrUndefined;
searchAfterSortIds: SortResults | undefined;
Expand Down Expand Up @@ -94,8 +94,6 @@ export const buildEventsSearchQuery = ({
];

const filterWithTime: estypes.QueryContainer[] = [
// but tests contain undefined, so I suppose it's desired behavior
// @ts-expect-error undefined in not assignable to QueryContainer
filter,
{ bool: { filter: [{ bool: { should: [...rangeFilter], minimum_should_match: 1 } }] } },
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('singleSearchAfter', () => {
services: mockService,
logger: mockLogger,
pageSize: 1,
filter: undefined,
filter: {},
timestampOverride: undefined,
buildRuleMessage,
});
Expand All @@ -59,7 +59,7 @@ describe('singleSearchAfter', () => {
services: mockService,
logger: mockLogger,
pageSize: 1,
filter: undefined,
filter: {},
timestampOverride: undefined,
buildRuleMessage,
});
Expand Down Expand Up @@ -109,7 +109,7 @@ describe('singleSearchAfter', () => {
services: mockService,
logger: mockLogger,
pageSize: 1,
filter: undefined,
filter: {},
timestampOverride: undefined,
buildRuleMessage,
});
Expand All @@ -132,7 +132,7 @@ describe('singleSearchAfter', () => {
services: mockService,
logger: mockLogger,
pageSize: 1,
filter: undefined,
filter: {},
timestampOverride: undefined,
buildRuleMessage,
});
Expand All @@ -152,7 +152,7 @@ describe('singleSearchAfter', () => {
services: mockService,
logger: mockLogger,
pageSize: 1,
filter: undefined,
filter: {},
timestampOverride: undefined,
buildRuleMessage,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface SingleSearchAfterParams {
logger: Logger;
pageSize: number;
sortOrder?: SortOrderOrUndefined;
filter?: estypes.QueryContainer;
filter: estypes.QueryContainer;
timestampOverride: TimestampOverrideOrUndefined;
buildRuleMessage: BuildRuleMessage;
}
Expand Down

0 comments on commit b301d84

Please sign in to comment.