[improvement] Area: support oversrea code (#1897)

This commit is contained in:
neverland
2018-10-09 16:28:19 +08:00
committed by GitHub
parent f5e114cf08
commit ae15bbd141
5 changed files with 64 additions and 44 deletions

View File

@@ -120,26 +120,6 @@ test('valid postal code', () => {
expect(errorInfo.postalCode).toBeFalsy();
});
test('select area', () => {
const wrapper = mount(AddressEdit, {
propsData: {
areaList
}
});
const { vm } = wrapper;
const { data } = vm;
vm.onAreaConfirm([
{ name: '北京市' },
{ name: '北京市' },
{ name: '朝阳区', code: '123456' }
]);
expect(data.province).toEqual('北京市');
expect(data.city).toEqual('北京市');
expect(data.county).toEqual('朝阳区');
expect(data.areaCode).toEqual('123456');
});
test('on change detail', () => {
const wrapper = mount(AddressEdit);
const field = wrapper.findAll('.van-field__control').at(3);