chore: add trailingComma
This commit is contained in:
@@ -11,7 +11,7 @@ const addressInfo = {
|
||||
addressDetail: '详细地址',
|
||||
areaCode: '110101',
|
||||
postalCode: '10000',
|
||||
isDefault: true
|
||||
isDefault: true,
|
||||
};
|
||||
|
||||
const createComponent = () => {
|
||||
@@ -20,8 +20,8 @@ const createComponent = () => {
|
||||
areaList,
|
||||
addressInfo,
|
||||
showPostal: true,
|
||||
showSetDefault: true
|
||||
}
|
||||
showSetDefault: true,
|
||||
},
|
||||
});
|
||||
|
||||
const button = wrapper.find('.van-button');
|
||||
@@ -33,7 +33,7 @@ const createComponent = () => {
|
||||
field,
|
||||
button,
|
||||
wrapper,
|
||||
errorInfo
|
||||
errorInfo,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -48,8 +48,8 @@ test('create a AddressEdit with props', () => {
|
||||
addressInfo,
|
||||
showPostal: true,
|
||||
showSetDefault: true,
|
||||
showSearchResult: true
|
||||
}
|
||||
showSearchResult: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -60,7 +60,7 @@ test('valid area placeholder confirm', async () => {
|
||||
propsData: {
|
||||
areaList,
|
||||
areaColumnsPlaceholder: ['请选择', '请选择', '请选择'],
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const { data } = wrapper.vm;
|
||||
@@ -100,8 +100,8 @@ test('validator props', async () => {
|
||||
areaList,
|
||||
validator(key, value) {
|
||||
return `${key}${value}`;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const { errorInfo, data } = wrapper.vm;
|
||||
@@ -192,13 +192,13 @@ test('watch address info', () => {
|
||||
|
||||
test('set/get area code', async () => {
|
||||
const wrapper = mount(AddressEdit, {
|
||||
propsData: { areaList }
|
||||
propsData: { areaList },
|
||||
});
|
||||
|
||||
expect(wrapper.vm.getArea()).toEqual([
|
||||
{ code: '110000', name: '北京市' },
|
||||
{ code: '110100', name: '北京市' },
|
||||
{ code: '110101', name: '东城区' }
|
||||
{ code: '110101', name: '东城区' },
|
||||
]);
|
||||
|
||||
wrapper.vm.setAreaCode('110102');
|
||||
@@ -208,7 +208,7 @@ test('set/get area code', async () => {
|
||||
expect(wrapper.vm.getArea()).toEqual([
|
||||
{ code: '110000', name: '北京市' },
|
||||
{ code: '110100', name: '北京市' },
|
||||
{ code: '110102', name: '西城区' }
|
||||
{ code: '110102', name: '西城区' },
|
||||
]);
|
||||
|
||||
wrapper.vm.$refs = [];
|
||||
@@ -221,9 +221,9 @@ test('watch area code', async () => {
|
||||
propsData: {
|
||||
areaList: {},
|
||||
addressInfo: {
|
||||
areaCode: '110101'
|
||||
}
|
||||
}
|
||||
areaCode: '110101',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.vm.data.city).toEqual('');
|
||||
@@ -240,9 +240,9 @@ test('show search result', async () => {
|
||||
searchResult: [
|
||||
{ name: 'name1', address: 'address1' },
|
||||
{ name: 'name2' },
|
||||
{ address: 'address2' }
|
||||
]
|
||||
}
|
||||
{ address: 'address2' },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const field = wrapper.findAll('.van-field__control').at(3);
|
||||
@@ -266,8 +266,8 @@ test('delete address', async () => {
|
||||
const wrapper = mount(AddressEdit, {
|
||||
attachToDocument: true,
|
||||
propsData: {
|
||||
showDelete: true
|
||||
}
|
||||
showDelete: true,
|
||||
},
|
||||
});
|
||||
|
||||
const deleteButton = wrapper.findAll('.van-button').at(1);
|
||||
|
||||
Reference in New Issue
Block a user