Skip to content

Commit

Permalink
Separate tests for ip/strings
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Mar 31, 2023
1 parent f02cbb9 commit 0e2c81f
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ describe('FieldSuggestions', () => {
expect(http.fetch).not.toHaveBeenCalled();
});

it('should otherwise request suggestions', async () => {
it('should request suggestions for strings', async () => {
const [field] = stubFields.filter(
({ type, aggregatable }) => (type === 'string' || type === 'ip') && aggregatable
({ type, aggregatable }) => type === 'string' && aggregatable
);

await getValueSuggestions({
Expand All @@ -113,6 +113,19 @@ describe('FieldSuggestions', () => {
expect(http.fetch).toHaveBeenCalled();
});

it('should request suggestions for ips', async () => {
const [field] = stubFields.filter(({ type, aggregatable }) => type === 'ip' && aggregatable);

await getValueSuggestions({
indexPattern: stubIndexPattern,
field,
query: '',
useTimeRange: false,
});

expect(http.fetch).toHaveBeenCalled();
});

it('should cache results if using the same index/field/query/filter', async () => {
const [field] = stubFields.filter(
({ type, aggregatable }) => type === 'string' && aggregatable
Expand Down

0 comments on commit 0e2c81f

Please sign in to comment.