chore(deps): update all non-major dependencies (#615)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
This commit is contained in:
renovate[bot]
2023-06-22 15:21:41 +08:00
committed by GitHub
parent dbba3205e4
commit 5a25165e66
6 changed files with 243 additions and 168 deletions

View File

@ -40,7 +40,7 @@
"@types/babel__traverse": "^7.20.1",
"@types/svg-tags": "^1.0.0",
"@vue/runtime-dom": "^3.3.4",
"@vue/test-utils": "^2.3.2",
"@vue/test-utils": "^2.4.0",
"regenerator-runtime": "^0.13.11",
"vue": "^3.3.4"
},

View File

@ -429,32 +429,34 @@ describe('variables outside slots', () => {
});
test('forwarded', async () => {
const wrapper = mount({
data() {
return {
val: 0,
};
},
methods: {
inc() {
this.val += 1;
const wrapper = mount(
defineComponent({
data() {
return {
val: 0,
};
},
},
render() {
const attrs = {
innerHTML: `${this.val}`,
};
const textarea = <textarea id="textarea" {...attrs} />;
return (
<A inc={this.inc}>
<div>{textarea}</div>
<button id="button" onClick={this.inc}>
+1
</button>
</A>
);
},
});
methods: {
inc() {
this.val += 1;
},
},
render() {
const attrs = {
innerHTML: `${this.val}`,
};
const textarea = <textarea id="textarea" {...attrs} />;
return (
<A inc={this.inc}>
<div>{textarea}</div>
<button id="button" onClick={this.inc}>
+1
</button>
</A>
);
},
})
);
expect(wrapper.get('#textarea').element.innerHTML).toBe('0');
await wrapper.get('#button').trigger('click');

View File

@ -3,7 +3,7 @@ import { type VNode, defineComponent } from '@vue/runtime-dom';
test('input[type="checkbox"] should work', async () => {
const wrapper = shallowMount(
{
defineComponent({
data() {
return {
test: true,
@ -12,7 +12,7 @@ test('input[type="checkbox"] should work', async () => {
render() {
return <input type="checkbox" v-model={this.test} />;
},
},
}),
{ attachTo: document.body }
);
@ -28,7 +28,7 @@ test('input[type="checkbox"] should work', async () => {
test('input[type="radio"] should work', async () => {
const wrapper = shallowMount(
{
defineComponent({
data: () => ({
test: '1',
}),
@ -40,7 +40,7 @@ test('input[type="radio"] should work', async () => {
</>
);
},
},
}),
{ attachTo: document.body }
);
@ -58,20 +58,22 @@ test('input[type="radio"] should work', async () => {
});
test('select should work with value bindings', async () => {
const wrapper = shallowMount({
data: () => ({
test: 2,
}),
render() {
return (
<select v-model={this.test}>
<option value="1">a</option>
<option value={2}>b</option>
<option value={3}>c</option>
</select>
);
},
});
const wrapper = shallowMount(
defineComponent({
data: () => ({
test: 2,
}),
render() {
return (
<select v-model={this.test}>
<option value="1">a</option>
<option value={2}>b</option>
<option value={3}>c</option>
</select>
);
},
})
);
const el = wrapper.vm.$el;
@ -92,14 +94,16 @@ test('select should work with value bindings', async () => {
});
test('textarea should update value both ways', async () => {
const wrapper = shallowMount({
data: () => ({
test: 'b',
}),
render() {
return <textarea v-model={this.test} />;
},
});
const wrapper = shallowMount(
defineComponent({
data: () => ({
test: 'b',
}),
render() {
return <textarea v-model={this.test} />;
},
})
);
const el = wrapper.vm.$el;
expect(el.value).toBe('b');
@ -112,14 +116,16 @@ test('textarea should update value both ways', async () => {
});
test('input[type="text"] should update value both ways', async () => {
const wrapper = shallowMount({
data: () => ({
test: 'b',
}),
render() {
return <input v-model={this.test} />;
},
});
const wrapper = shallowMount(
defineComponent({
data: () => ({
test: 'b',
}),
render() {
return <input v-model={this.test} />;
},
})
);
const el = wrapper.vm.$el;
expect(el.value).toBe('b');
@ -132,14 +138,16 @@ test('input[type="text"] should update value both ways', async () => {
});
test('input[type="text"] .lazy modifier', async () => {
const wrapper = shallowMount({
data: () => ({
test: 'b',
}),
render() {
return <input v-model={[this.test, ['lazy']]} />;
},
});
const wrapper = shallowMount(
defineComponent({
data: () => ({
test: 'b',
}),
render() {
return <input v-model={[this.test, ['lazy']]} />;
},
})
);
const el = wrapper.vm.$el;
expect(el.value).toBe('b');
@ -153,17 +161,19 @@ test('input[type="text"] .lazy modifier', async () => {
});
test('dynamic type should work', async () => {
const wrapper = shallowMount({
data() {
return {
test: true,
type: 'checkbox',
};
},
render() {
return <input type={this.type} v-model={this.test} />;
},
});
const wrapper = shallowMount(
defineComponent({
data() {
return {
test: true,
type: 'checkbox',
};
},
render() {
return <input type={this.type} v-model={this.test} />;
},
})
);
expect(wrapper.vm.$el.checked).toBe(true);
wrapper.vm.test = false;
@ -172,14 +182,16 @@ test('dynamic type should work', async () => {
});
test('underscore modifier should work', async () => {
const wrapper = shallowMount({
data: () => ({
test: 'b',
}),
render() {
return <input v-model_lazy={this.test} />;
},
});
const wrapper = shallowMount(
defineComponent({
data: () => ({
test: 'b',
}),
render() {
return <input v-model_lazy={this.test} />;
},
})
);
const el = wrapper.vm.$el;
expect(el.value).toBe('b');
@ -218,16 +230,18 @@ test('underscore modifier should work in custom component', async () => {
},
});
const wrapper = mount({
data() {
return {
foo: 1,
};
},
render() {
return <Child v-model_double={this.foo} />;
},
});
const wrapper = mount(
defineComponent({
data() {
return {
foo: 1,
};
},
render() {
return <Child v-model_double={this.foo} />;
},
})
);
expect(wrapper.html()).toBe('<div>2</div>');
wrapper.vm.$data.foo += 1;
@ -254,14 +268,16 @@ test('Named model', async () => {
},
});
const wrapper = mount({
data: () => ({
foo: 0,
}),
render() {
return <Child v-model:value={this.foo} />;
},
});
const wrapper = mount(
defineComponent({
data: () => ({
foo: 0,
}),
render() {
return <Child v-model:value={this.foo} />;
},
})
);
expect(wrapper.html()).toBe('<div>0</div>');
wrapper.vm.$data.foo += 1;

View File

@ -15,16 +15,18 @@ test('single value binding should work', async () => {
},
});
const wrapper = mount({
data() {
return {
foo: 1,
};
},
render() {
return <Child v-models={[[this.foo, 'foo']]} />;
},
});
const wrapper = mount(
defineComponent({
data() {
return {
foo: 1,
};
},
render() {
return <Child v-models={[[this.foo, 'foo']]} />;
},
})
);
expect(wrapper.html()).toBe('<div>1</div>');
wrapper.vm.$data.foo += 1;
@ -54,24 +56,26 @@ test('multiple values binding should work', async () => {
},
});
const wrapper = mount({
data() {
return {
foo: 1,
bar: 0,
};
},
render() {
return (
<Child
v-models={[
[this.foo, 'foo'],
[this.bar, 'bar'],
]}
/>
);
},
});
const wrapper = mount(
defineComponent({
data() {
return {
foo: 1,
bar: 0,
};
},
render() {
return (
<Child
v-models={[
[this.foo, 'foo'],
[this.bar, 'bar'],
]}
/>
);
},
})
);
expect(wrapper.html()).toBe('<div>1,0</div>');
wrapper.vm.$data.foo += 1;
@ -106,16 +110,18 @@ test('modifier should work', async () => {
},
});
const wrapper = mount({
data() {
return {
foo: 1,
};
},
render() {
return <Child v-models={[[this.foo, 'foo', ['double']]]} />;
},
});
const wrapper = mount(
defineComponent({
data() {
return {
foo: 1,
};
},
render() {
return <Child v-models={[[this.foo, 'foo', ['double']]]} />;
},
})
);
expect(wrapper.html()).toBe('<div>2</div>');
wrapper.vm.$data.foo += 1;