[Improvement] Area: add reset method (#1427)

This commit is contained in:
neverland
2018-07-06 20:04:38 +08:00
committed by GitHub
parent e34c940063
commit 0718339c81
6 changed files with 105 additions and 1 deletions

View File

@@ -64,8 +64,25 @@ test('getValues method', () => {
const wrapper = mount(Area, {
propsData: {
areaList
},
created() {
expect(this.getValues()).toEqual([]);
}
});
expect(wrapper.vm.getValues()).toEqual(firstOption);
});
test('reset method', async() => {
const wrapper = mount(Area, {
propsData: {
areaList,
value: '120225'
}
});
await later();
expect(wrapper).toMatchSnapshot();
wrapper.vm.reset();
expect(wrapper).toMatchSnapshot();
});