mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-15 09:21:25 +08:00
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
import { mount } from '@vue/test-utils';
|
|
import { asyncExpect } from '@/tests/utils';
|
|
import Slider from '..';
|
|
import mountTest from '../../../tests/shared/mountTest';
|
|
|
|
describe('Slider', () => {
|
|
mountTest(Slider);
|
|
it('should show tooltip when hovering slider handler', async () => {
|
|
const wrapper = mount(Slider, {
|
|
props: {
|
|
defaultValue: 30,
|
|
},
|
|
sync: false,
|
|
});
|
|
await asyncExpect(() => {
|
|
wrapper
|
|
.findAll('.ant-slider-handle')
|
|
.at(0)
|
|
.trigger('mouseenter');
|
|
});
|
|
let dropdownWrapper = null;
|
|
await asyncExpect(() => {
|
|
dropdownWrapper = mount(
|
|
{
|
|
render() {
|
|
return wrapper.find({ name: 'Trigger' }).vm.getComponent();
|
|
},
|
|
},
|
|
{ sync: false },
|
|
);
|
|
});
|
|
await asyncExpect(() => {
|
|
expect(dropdownWrapper.html()).toMatchSnapshot();
|
|
wrapper
|
|
.findAll('.ant-slider-handle')
|
|
.at(0)
|
|
.trigger('mouseleave');
|
|
});
|
|
await asyncExpect(() => {
|
|
dropdownWrapper = mount(
|
|
{
|
|
render() {
|
|
return wrapper.find({ name: 'Trigger' }).vm.getComponent();
|
|
},
|
|
},
|
|
{ sync: false },
|
|
);
|
|
});
|
|
await asyncExpect(() => {
|
|
expect(dropdownWrapper.html()).toMatchSnapshot();
|
|
});
|
|
});
|
|
});
|