2019-01-12 03:33:27 +00:00
|
|
|
import { mount } from '@vue/test-utils';
|
|
|
|
import { asyncExpect } from '@/tests/utils';
|
|
|
|
import Slider from '..';
|
2020-03-07 11:45:13 +00:00
|
|
|
import mountTest from '../../../tests/shared/mountTest';
|
2018-06-06 02:48:15 +00:00
|
|
|
|
|
|
|
describe('Slider', () => {
|
2020-03-07 11:45:13 +00:00
|
|
|
mountTest(Slider);
|
2018-06-06 02:48:15 +00:00
|
|
|
it('should show tooltip when hovering slider handler', async () => {
|
|
|
|
const wrapper = mount(Slider, {
|
2020-07-25 07:46:49 +00:00
|
|
|
props: {
|
2018-06-06 02:48:15 +00:00
|
|
|
defaultValue: 30,
|
|
|
|
},
|
|
|
|
sync: false,
|
2020-08-03 14:38:35 +00:00
|
|
|
attachTo: 'body',
|
2019-01-12 03:33:27 +00:00
|
|
|
});
|
2018-06-06 02:48:15 +00:00
|
|
|
await asyncExpect(() => {
|
2020-08-03 14:38:35 +00:00
|
|
|
wrapper.findAll('.ant-slider-handle')[0].trigger('mouseenter');
|
2019-01-12 03:33:27 +00:00
|
|
|
});
|
2018-06-06 02:48:15 +00:00
|
|
|
await asyncExpect(() => {
|
2020-08-03 14:38:35 +00:00
|
|
|
expect(document.body.innerHTML).toMatchSnapshot();
|
|
|
|
wrapper.findAll('.ant-slider-handle')[0].trigger('mouseleave');
|
2019-01-12 03:33:27 +00:00
|
|
|
});
|
2018-06-06 02:48:15 +00:00
|
|
|
await asyncExpect(() => {
|
2020-08-03 14:38:35 +00:00
|
|
|
expect(document.body.innerHTML).toMatchSnapshot();
|
2019-01-12 03:33:27 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|