[Improvement] Slider: add test cases (#1192)

This commit is contained in:
neverland
2018-05-30 14:57:14 +08:00
committed by GitHub
parent 4614260e1c
commit 92c108e245
10 changed files with 104 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
import Picker from '../';
import PickerColumn from '../PickerColumn';
import { mount } from '@vue/test-utils';
import { triggerDrag } from '../../../test/touch-utils';
import { triggerDrag } from '../../../test/utils';
const simpleColumn = ['1990', '1991', '1992', '1993', '1994', '1995'];
const columns = [
@@ -27,7 +27,7 @@ test('simple columns confirm & cancel event', () => {
wrapper.find('.van-picker__cancel').trigger('click');
expect(wrapper.emitted('confirm')[0]).toEqual(['1990', 0]);
expect(wrapper.emitted('cancel')[0]).toEqual(['1990', 0]);
wrapper.vm.$destroy();
wrapper.destroy();
});
test('multiple columns confirm & cancel event', () => {