mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 19:24:16 +00:00
[Improvement] Area: add reset method (#1427)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user