Skip to content

Commit 883c1ca

Browse files
committed
test(core): change value to modelValue
1 parent 42ee42d commit 883c1ca

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

core/src/core.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default {
106106
},
107107
108108
watch: {
109-
value: {
109+
modelValue: {
110110
handler: function (value) {
111111
this.cronToSelected(value)
112112
},

core/test/core.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('test VueCron', async () => {
88

99
const wrapper = mount(VueCron, {
1010
props: {
11-
value: '*/15 12 * * *'
11+
modelValue: '*/15 12 * * *'
1212
},
1313
slots: {
1414
default: function (p) {
@@ -19,16 +19,16 @@ test('test VueCron', async () => {
1919

2020
await wrapper.vm.$nextTick()
2121

22-
expect(slotProps.fields[4].attrs.value).toEqual([0, 15, 30, 45])
23-
expect(slotProps.fields[3].attrs.value).toEqual([12])
24-
expect(slotProps.fields[2].attrs.value).toEqual([])
25-
expect(slotProps.fields[1].attrs.value).toEqual([])
26-
expect(slotProps.fields[0].attrs.value).toEqual([])
22+
expect(slotProps.fields[4].attrs.modelValue).toEqual([0, 15, 30, 45])
23+
expect(slotProps.fields[3].attrs.modelValue).toEqual([12])
24+
expect(slotProps.fields[2].attrs.modelValue).toEqual([])
25+
expect(slotProps.fields[1].attrs.modelValue).toEqual([])
26+
expect(slotProps.fields[0].attrs.modelValue).toEqual([])
2727

28-
slotProps.fields[4].events.input([1, 2, 3, 4, 5])
28+
slotProps.fields[4].events['update:model-value']([1, 2, 3, 4, 5])
2929

3030
await wrapper.vm.$nextTick()
3131

32-
expect(wrapper.emitted()).toHaveProperty('update:value')
33-
expect(wrapper.emitted('update:value')[0]).toEqual(['1-5 12 * * *'])
32+
expect(wrapper.emitted()).toHaveProperty('update:model-value')
33+
expect(wrapper.emitted('update:model-value')[0]).toEqual(['1-5 12 * * *'])
3434
})

0 commit comments

Comments
 (0)