Skip to content

Commit

Permalink
add test case for commit 368eb03e200b755870f1ad373e67561201ab6f31 (#370)
Browse files Browse the repository at this point in the history
Add missing test case for the fix "pass doc[field] == null"
  • Loading branch information
zhongnansu committed May 21, 2021
1 parent 0c06ab8 commit 19794af
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,20 @@ describe('test create saved search report', () => {
}, 20000);
});

test('create report for data set contains null field value', async () => {
const hits = [
hit({ category: 'c1', customer_gender: 'Ma' }),
hit({ category: 'c2', customer_gender: 'le' }),
hit({ category: 'c3', customer_gender: null }),
];
const client = mockEsClient(hits);
const { dataUrl } = await createSavedSearchReport(input, client);

expect(dataUrl).toEqual(
'category,customer_gender\n' + 'c1,Ma\n' + 'c2,le\n' + 'c3, '
);
}, 20000);

/**
* Mock Elasticsearch client and return different mock objects based on endpoint and parameters.
*/
Expand Down

0 comments on commit 19794af

Please sign in to comment.