-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b74921a
commit 6811461
Showing
4 changed files
with
63 additions
and
34 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...indices/create_index_pattern_wizard/components/step_index_pattern/__tests__/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const render = jest.fn(); | ||
const unmountComponentAtNode = jest.fn(); | ||
|
||
jest.doMock('react-dom', () => ({ render, unmountComponentAtNode })); | ||
|
||
const { renderStepIndexPattern, destroyStepIndexPattern } = require('../index'); | ||
|
||
describe('StepIndexPatternRender', () => { | ||
beforeEach(() => { | ||
render.mockClear(); | ||
unmountComponentAtNode.mockClear(); | ||
}); | ||
|
||
it('should call render', () => { | ||
renderStepIndexPattern( | ||
'reactDiv', | ||
[], | ||
'', | ||
false, | ||
{}, | ||
() => {} | ||
); | ||
|
||
expect(render.mock.calls.length).toBe(1); | ||
}); | ||
|
||
it('should call unmountComponentAtNode', () => { | ||
destroyStepIndexPattern('reactDiv'); | ||
expect(unmountComponentAtNode.mock.calls.length).toBe(1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters