Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Jun 27, 2021
1 parent 9111374 commit 5b40ebc
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 @@ -32,7 +32,6 @@ describe('interpreter/functions#phraseFilter', () => {
"something",
],
"type": "phrases",
"value": "test, something",
},
"query": Object {
"bool": Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ describe('getDisplayValueFromFilter', () => {
});

it('calls the value function if proivided', () => {
// The type of value currently doesn't match how it's used. Refactor needed.
phraseFilter.meta.value = jest.fn((x) => {
return 'abc';
});
}) as any;
const displayValue = getDisplayValueFromFilter(phraseFilter, [stubIndexPattern]);
expect(displayValue).toBe('abc');
expect(phraseFilter.meta.value).toHaveBeenCalledWith(undefined);
Expand All @@ -35,7 +36,7 @@ describe('getDisplayValueFromFilter', () => {
stubIndexPattern.getFormatterForField = jest.fn().mockReturnValue('banana');
phraseFilter.meta.value = jest.fn((x) => {
return x + 'abc';
});
}) as any;
const displayValue = getDisplayValueFromFilter(phraseFilter, [stubIndexPattern]);
expect(stubIndexPattern.getFormatterForField).toHaveBeenCalledTimes(1);
expect(phraseFilter.meta.value).toHaveBeenCalledWith('banana');
Expand Down

0 comments on commit 5b40ebc

Please sign in to comment.