Browse Source
* fix: ConfigProvider getPopupContainer invalid * slider getPopupContainer * Create container.test.js * Update container.test.jspull/23596/head
Tom Xu
5 years ago
committed by
GitHub
4 changed files with 74 additions and 44 deletions
@ -0,0 +1,28 @@ |
|||
import React from 'react'; |
|||
import { mount } from 'enzyme'; |
|||
import ConfigProvider from '..'; |
|||
import DatePicker from '../../date-picker'; |
|||
import Slider from '../../slider'; |
|||
|
|||
describe('ConfigProvider.GetPopupContainer', () => { |
|||
it('Datepicker', () => { |
|||
const getPopupContainer = jest.fn(node => node.parentNode); |
|||
mount( |
|||
<ConfigProvider getPopupContainer={getPopupContainer}> |
|||
<DatePicker open /> |
|||
</ConfigProvider>, |
|||
); |
|||
expect(getPopupContainer).toHaveBeenCalled(); |
|||
}); |
|||
|
|||
it('Slider', () => { |
|||
const getPopupContainer = jest.fn(node => node.parentNode); |
|||
const wrapper = mount( |
|||
<ConfigProvider getPopupContainer={getPopupContainer}> |
|||
<Slider /> |
|||
</ConfigProvider>, |
|||
); |
|||
wrapper.find('.ant-slider-handle').first().simulate('mouseenter'); |
|||
expect(getPopupContainer).toHaveBeenCalled(); |
|||
}); |
|||
}); |
Loading…
Reference in new issue