Merge branch '2.x' into dev

This commit is contained in:
chenjiahan
2020-10-31 18:19:32 +08:00
29 changed files with 324 additions and 69 deletions
+7 -2
View File
@@ -27,9 +27,10 @@ test('insert tab dynamically', async () => {
});
test('insert tab with name dynamically', async () => {
const onChange = jest.fn();
const wrapper = mount({
template: `
<van-tabs v-model="active">
<van-tabs v-model="active" @change="onChange">
<van-tab v-if="insert" title="1" name="bar">2</van-tab>
<van-tab title="2" name="foo">1</van-tab>
</van-tabs>
@@ -37,14 +38,18 @@ test('insert tab with name dynamically', async () => {
data() {
return {
insert: false,
active: [{ name: 'foo', title: 'foo' }],
active: 'foo',
};
},
methods: {
onChange,
},
});
await later();
wrapper.setData({ insert: true });
expect(wrapper).toMatchSnapshot();
expect(onChange).toHaveBeenCalledTimes(0);
});
// this case will throw wierd error in index.spec.js