mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
bump vue-test-utils (#1338)
This commit is contained in:
parent
30928595d3
commit
83ab9b1917
@ -56,8 +56,8 @@
|
||||
"vue": ">= 2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/server-test-utils": "^1.0.0-beta.16",
|
||||
"@vue/test-utils": "^1.0.0-beta.16",
|
||||
"@vue/server-test-utils": "^1.0.0-beta.20",
|
||||
"@vue/test-utils": "^1.0.0-beta.20",
|
||||
"autoprefixer": "^8.6.4",
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-core": "^6.26.3",
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
import Actionsheet from '../';
|
||||
|
||||
test('callback events', () => {
|
||||
const callback = jest.fn();
|
||||
const wrapper = shallowMount(Actionsheet, {
|
||||
const wrapper = mount(Actionsheet, {
|
||||
propsData: {
|
||||
actions: [
|
||||
{ name: 'Option', callback },
|
||||
|
@ -216,9 +216,9 @@ export default create({
|
||||
|
||||
assignAreaValues(values) {
|
||||
Object.assign(this.data, {
|
||||
province: values[0].name,
|
||||
city: values[1].name,
|
||||
county: values[2].name
|
||||
province: values[0] ? values[0].name : '',
|
||||
city: values[1] ? values[1].name : '',
|
||||
county: values[2] ? values[2].name : ''
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
/* eslint-disable camelcase */
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { renderToString } from '@vue/server-test-utils';
|
||||
import AddressEdit from '../';
|
||||
import areaList from '../../area/demo/area.simple';
|
||||
import { later, transitionStub } from '../../../test/utils';
|
||||
import { mount, later, transitionStub } from '../../../test/utils';
|
||||
|
||||
transitionStub();
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
import Area from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import areaList from '../demo/area.simple';
|
||||
import { later, triggerDrag } from '../../../test/utils';
|
||||
import { mount, later, triggerDrag } from '../../../test/utils';
|
||||
|
||||
const firstOption = [
|
||||
{ code: '110000', name: '北京市' },
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
import Badge from '../';
|
||||
import BadgeGroup from '../../badge-group';
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import CellSwipe from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { triggerDrag } from '../../../test/utils';
|
||||
import { mount, triggerDrag } from '../../../test/utils';
|
||||
|
||||
const defaultProps = {
|
||||
propsData: {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Cell from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('click event', () => {
|
||||
const wrapper = mount(Cell);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Checkbox from '..';
|
||||
import CheckboxGroup from '../../checkbox-group';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('switch checkbox', () => {
|
||||
const wrapper = mount(Checkbox);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Collapse from '..';
|
||||
import CollapseItem from '../../collapse-item';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
const component = {
|
||||
template: `
|
||||
|
@ -1,8 +1,7 @@
|
||||
import ContactCard from '..';
|
||||
import ContactList from '../../contact-list';
|
||||
import ContactEdit from '../../contact-edit';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { later } from '../../../test/utils';
|
||||
import { mount, later } from '../../../test/utils';
|
||||
|
||||
const contactInfo = {
|
||||
name: 'test',
|
||||
|
@ -1,6 +1,6 @@
|
||||
import CouponList from '../../coupon-list';
|
||||
import CouponCell from '../../coupon-cell';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('exchange coupon', () => {
|
||||
const wrapper = mount(CouponList);
|
||||
|
@ -1,8 +1,7 @@
|
||||
import Vue from 'vue';
|
||||
import Dialog from '..';
|
||||
import DialogVue from '../dialog';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { later, transitionStub } from '../../../test/utils';
|
||||
import { mount, later, transitionStub } from '../../../test/utils';
|
||||
|
||||
transitionStub();
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import Field from '../';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { later } from '../../../test/utils';
|
||||
import { mount, later } from '../../../test/utils';
|
||||
|
||||
test('input event', () => {
|
||||
const wrapper = mount(Field);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import BigBtn from '../../goods-action-big-btn';
|
||||
import SmallBtn from '../../goods-action-mini-btn';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('big btn click event', () => {
|
||||
const wrapper = mount(BigBtn);
|
||||
|
@ -1,8 +1,7 @@
|
||||
import Vue from 'vue';
|
||||
import ImagePreview from '..';
|
||||
import ImagePreviewVue from '../image-preview';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { triggerDrag } from '../../../test/utils';
|
||||
import { mount, triggerDrag } from '../../../test/utils';
|
||||
|
||||
const images = [
|
||||
'https://img.yzcdn.cn/1.png',
|
||||
|
@ -1,6 +1,5 @@
|
||||
import List from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { later } from '../../../test/utils';
|
||||
import { mount, later } from '../../../test/utils';
|
||||
|
||||
test('load event', async() => {
|
||||
const wrapper = mount(List);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import NumberKeyboard from '../';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
function mockTouch(wrapper, event, keyIndex) {
|
||||
const key = wrapper.element.querySelectorAll('.van-key')[keyIndex];
|
||||
|
@ -59,7 +59,7 @@ export default create({
|
||||
},
|
||||
|
||||
created() {
|
||||
this.$parent && this.$parent.children.push(this);
|
||||
this.$parent.children && this.$parent.children.push(this);
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@ -67,7 +67,7 @@ export default create({
|
||||
},
|
||||
|
||||
destroyed() {
|
||||
this.$parent && this.$parent.children.splice(this.$parent.children.indexOf(this), 1);
|
||||
this.$parent.children && this.$parent.children.splice(this.$parent.children.indexOf(this), 1);
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import Picker from '../';
|
||||
import PickerColumn from '../PickerColumn';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { triggerDrag } from '../../../test/utils';
|
||||
import { mount, triggerDrag } from '../../../test/utils';
|
||||
|
||||
const simpleColumn = ['1990', '1991', '1992', '1993', '1994', '1995'];
|
||||
const columns = [
|
||||
|
@ -1,9 +1,7 @@
|
||||
import Vue from 'vue';
|
||||
import Popup from '../';
|
||||
import { mount, TransitionStub } from '@vue/test-utils';
|
||||
import { triggerDrag } from '../../../test/utils';
|
||||
import { mount, triggerDrag, transitionStub } from '../../../test/utils';
|
||||
|
||||
Vue.component('transition', TransitionStub);
|
||||
transitionStub();
|
||||
|
||||
let wrapper;
|
||||
afterEach(() => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Progress from '../';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('calc width', () => {
|
||||
const wrapper = mount(Progress, {
|
||||
|
@ -1,6 +1,5 @@
|
||||
import PullRefresh from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { trigger, triggerDrag } from '../../../test/utils';
|
||||
import { mount, trigger, triggerDrag } from '../../../test/utils';
|
||||
|
||||
test('change head content when pulling down', () => {
|
||||
const wrapper = mount(PullRefresh, {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Rate from '../';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('change event', () => {
|
||||
const wrapper = mount(Rate, {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Search from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('listen input event', () => {
|
||||
const wrapper = mount(Search);
|
||||
|
@ -1,6 +1,5 @@
|
||||
import Slider from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { triggerDrag, trigger } from '../../../test/utils';
|
||||
import { mount, triggerDrag, trigger } from '../../../test/utils';
|
||||
|
||||
Element.prototype.getBoundingClientRect = jest.fn(() => ({ width: 100, left: 0 }));
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Stepper from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('disabled stepper', () => {
|
||||
const wrapper = mount(Stepper, {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import SubmitBar from '../';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('submit', () => {
|
||||
const wrapper = mount(SubmitBar, {
|
||||
|
@ -1,7 +1,6 @@
|
||||
import Swipe from '..';
|
||||
import SwipeItem from '../../swipe-item';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { triggerDrag, later } from '../../../test/utils';
|
||||
import { mount, triggerDrag, later } from '../../../test/utils';
|
||||
|
||||
const Component = {
|
||||
template: `
|
||||
|
@ -1,5 +1,5 @@
|
||||
import SwitchCell from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('emit event', () => {
|
||||
const wrapper = mount(SwitchCell);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Switch from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('emit event', () => {
|
||||
const wrapper = mount(Switch);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import TreeSelect from '../';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
test('empty list', () => {
|
||||
expect(mount(TreeSelect)).toMatchSnapshot();
|
||||
|
@ -1,6 +1,5 @@
|
||||
import Uploader from '..';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { later } from '../../../test/utils';
|
||||
import { mount, later } from '../../../test/utils';
|
||||
|
||||
window.File = function() {
|
||||
this.size = 10000;
|
||||
|
@ -1,5 +1,12 @@
|
||||
import Vue from 'vue';
|
||||
import { TransitionStub } from '@vue/test-utils';
|
||||
import { mount, TransitionStub } from '@vue/test-utils';
|
||||
|
||||
// prevent vue warning log
|
||||
Vue.config.silent = true;
|
||||
|
||||
export {
|
||||
mount
|
||||
};
|
||||
|
||||
// Trigger pointer/touch event
|
||||
export function trigger(wrapper, eventName, x = 0, y = 0) {
|
||||
|
12
yarn.lock
12
yarn.lock
@ -137,15 +137,15 @@
|
||||
source-map "^0.5.6"
|
||||
vue-template-es2015-compiler "^1.6.0"
|
||||
|
||||
"@vue/server-test-utils@^1.0.0-beta.16":
|
||||
version "1.0.0-beta.16"
|
||||
resolved "https://registry.yarnpkg.com/@vue/server-test-utils/-/server-test-utils-1.0.0-beta.16.tgz#6fee1d086171b5581321de54b21ed16ef464813f"
|
||||
"@vue/server-test-utils@^1.0.0-beta.20":
|
||||
version "1.0.0-beta.20"
|
||||
resolved "https://registry.yarnpkg.com/@vue/server-test-utils/-/server-test-utils-1.0.0-beta.20.tgz#d71e3bacfc381a65b8c262a1787b1518b5017f35"
|
||||
dependencies:
|
||||
cheerio "^1.0.0-rc.2"
|
||||
|
||||
"@vue/test-utils@^1.0.0-beta.16":
|
||||
version "1.0.0-beta.16"
|
||||
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.16.tgz#dcf7a30304391422e382b5f97db6eb9508112906"
|
||||
"@vue/test-utils@^1.0.0-beta.20":
|
||||
version "1.0.0-beta.20"
|
||||
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.20.tgz#ef4505341b802f3de1c06b3cb8651378c87371fa"
|
||||
dependencies:
|
||||
lodash "^4.17.4"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user