Skip to content

Commit

Permalink
chore(deps): update all non-major dependencies (#615)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
  • Loading branch information
renovate[bot] and sxzz committed Jun 22, 2023
1 parent dbba320 commit 5a25165
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 168 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"packageManager": "[email protected].2",
"packageManager": "[email protected].3",
"scripts": {
"build": "pnpm run -r build",
"test": "vitest",
Expand All @@ -18,7 +18,7 @@
"@rollup/plugin-babel": "^6.0.3",
"@types/babel__core": "^7.20.1",
"@types/node": "^20.3.1",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@vitest/coverage-v8": "^0.32.2",
"bumpp": "^9.1.1",
"eslint": "^8.43.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-jsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
52 changes: 27 additions & 25 deletions packages/babel-plugin-jsx/test/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
174 changes: 95 additions & 79 deletions packages/babel-plugin-jsx/test/v-model.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -12,7 +12,7 @@ test('input[type="checkbox"] should work', async () => {
render() {
return <input type="checkbox" v-model={this.test} />;
},
},
}),
{ attachTo: document.body }
);

Expand All @@ -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',
}),
Expand All @@ -40,7 +40,7 @@ test('input[type="radio"] should work', async () => {
</>
);
},
},
}),
{ attachTo: document.body }
);

Expand All @@ -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;

Expand All @@ -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');
Expand All @@ -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');
Expand All @@ -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');
Expand All @@ -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;
Expand All @@ -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');
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Loading

0 comments on commit 5a25165

Please sign in to comment.