Skip to content

Commit

Permalink
Test for isCompatible=false when ES version check throws
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolf committed Jan 30, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b990cb7 commit b120ef3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -110,7 +110,8 @@ describe('mapNodesVersionCompatibility', () => {

describe('pollEsNodesVersion', () => {
const callWithInternalUser = jest.fn();
it('keeps polling when a poll request throws', done => {
const expectedCompatibilityResults = [false, false, true];
it('returns iscCompatible=false and keeps polling when a poll request throws', done => {
expect.assertions(3);
callWithInternalUser.mockResolvedValueOnce(createNodes('5.1.0', '5.2.0', '5.0.0'));
callWithInternalUser.mockRejectedValueOnce(new Error('mock request error'));
@@ -124,7 +125,9 @@ describe('pollEsNodesVersion', () => {
})
.pipe(take(3))
.subscribe({
next: result => expect(result.isCompatible).toBeDefined(),
next: result => {
expect(result.isCompatible).toBe(expectedCompatibilityResults.shift());
},
complete: done,
error: done,
});

0 comments on commit b120ef3

Please sign in to comment.