Skip to content

Commit

Permalink
update test to match
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Jun 29, 2021
1 parent 13c9f33 commit 7a35363
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,23 @@ it('uses the scrollId to page all the data', async () => {
const csvResult = await generateCsv.generateData();
expect(csvResult.warnings).toEqual([]);
expect(csvResult.content).toMatchSnapshot();

expect(mockDataClient.search).toHaveBeenCalledTimes(1);
expect(mockDataClient.search).toBeCalledWith(
{ params: { scroll: '30s', size: 500 } },
{ strategy: 'es' }
);

// `scroll` and `clearScroll` must be called with scroll ID in the post body!
expect(mockEsClient.asCurrentUser.scroll).toHaveBeenCalledTimes(9);
expect(mockEsClient.asCurrentUser.scroll).toHaveBeenCalledWith({
body: { scroll: '30s', scroll_id: 'awesome-scroll-hero' },
});

expect(mockEsClient.asCurrentUser.clearScroll).toHaveBeenCalledTimes(1);
expect(mockEsClient.asCurrentUser.clearScroll).toHaveBeenCalledWith({
body: { scroll_id: ['awesome-scroll-hero'] },
});
});

describe('fields from job.searchSource.getFields() (7.12 generated)', () => {
Expand Down

0 comments on commit 7a35363

Please sign in to comment.