@@ -46,23 +46,23 @@ This is table for those coming from VTU beta, comparing the two APIs. A lot of t
46
46
47
47
| option | status | notes |
48
48
| ---------| -------| ------|
49
- context | ⚰️ | different from Vue 2, may not make sense anymore.
50
49
data | ✅
51
50
slots | ✅ | has not been tested vigorously. Please try it out.
52
- scopedSlots | ⚰️ | scopedSlots are merged with slots in Vue 3
53
- stubs | ❌
54
51
mocks | ✅ | nested in [ ` global ` ] ( https://vuejs.github.io/vue-test-utils-next-docs/api/#global )
55
- localVue | ⚰️ | may not make sense anymore since we do not mutate the global Vue instance in Vue 3.
56
- attachToDocument | ❌| will rename to ` attachTo ` . See [ here] ( https://github.com/vuejs/vue-test-utils/pull/1492 )
57
- attrs | ❌ |
58
52
propsData | ✅ | now called ` props `
59
- listeners | ⚰️ | no longer exists in Vue 3
60
- parentComponent | ⚰️ |
61
53
provide | ✅ | nested in [ ` global ` ] ( https://vuejs.github.io/vue-test-utils-next-docs/api/#global )
62
54
mixins | ✅ | (new!) nested in [ ` global ` ] ( https://vuejs.github.io/vue-test-utils-next-docs/api/#global )
63
55
plugins | ✅ | (new!) nested in [ ` global ` ] ( https://vuejs.github.io/vue-test-utils-next-docs/api/#global )
64
56
component | ✅ | (new!) nested in [ ` global ` ] ( https://vuejs.github.io/vue-test-utils-next-docs/api/#global )
65
57
directives | ✅ | (new!) nested in [ ` global ` ] ( https://vuejs.github.io/vue-test-utils-next-docs/api/#global )
58
+ stubs | ❌
59
+ attachToDocument | ❌| will rename to ` attachTo ` . See [ here] ( https://github.com/vuejs/vue-test-utils/pull/1492 )
60
+ attrs | ❌ |
61
+ scopedSlots | ⚰️ | scopedSlots are merged with slots in Vue 3
62
+ context | ⚰️ | different from Vue 2, may not make sense anymore.
63
+ localVue | ⚰️ | may not make sense anymore since we do not mutate the global Vue instance in Vue 3.
64
+ listeners | ⚰️ | no longer exists in Vue 3
65
+ parentComponent | ⚰️ |
66
66
67
67
68
68
### Wrapper API (mount)
@@ -71,26 +71,26 @@ directives | ✅ | (new!) nested in [`global`](https://vuejs.github.io/vue-test-
71
71
| ---------| -------| ------|
72
72
attributes | ✅
73
73
classes | ✅
74
- contains | ⚰️| use ` find `
75
- destroy | ❌
76
- emitted | ✅
77
- emittedByOrder | ⚰️ | use ` emitted `
78
74
exists | ✅
79
75
find | ✅ | only ` querySelector ` syntax is supported. ` find(Comp) ` under discussion [ here] ( https://github.com/vuejs/vue-test-utils/issues/1498 )
76
+ emitted | ✅
80
77
findAll | ✅ | see above. ` .vm ` is different to Vue 2. We are exploring options.
81
- get | ❌
82
78
html | ✅
79
+ setValue | ✅ | works for select, checkbox, radio button, input, textarea. Returns ` nextTick ` .
80
+ text | ✅ |
81
+ trigger | ✅ | returns ` nextTick ` . You can do ` await wrapper.find('button').trigger('click') `
82
+ setProps | ✅ |
83
+ setData | ❌ | has PR
84
+ destroy | ❌
85
+ get | ❌
86
+ isVisible | ❌ | use matchers such as [ this] ( https://github.com/testing-library/jest-dom#tobeempty )
87
+ props | ❌
88
+ contains | ⚰️| use ` find `
89
+ emittedByOrder | ⚰️ | use ` emitted `
90
+ setSelected | ⚰️ | now part of ` setValue `
91
+ setChecked | ⚰️| now part of ` setValue `
83
92
is | ⚰️
84
93
isEmpty | ⚰️ | use matchers such as [ this] ( https://github.com/testing-library/jest-dom#tobeempty )
85
- isVisible | ❌ | use matchers such as [ this] ( https://github.com/testing-library/jest-dom#tobeempty )
86
94
isVueInstance | ⚰️
87
95
name | ⚰️ |
88
- props | ❌
89
- setChecked | ⚰️| now part of ` setValue `
90
- setData | ❌ |
91
- setMethods | ⚰️ |
92
- setProps | ❌ |
93
- setSelected | ⚰️ | now part of ` setValue `
94
- setValue | ✅ | works for select, checkbox, radio button, input, textarea. Returns ` nextTick ` .
95
- text | ✅ |
96
- trigger | ✅ | returns ` nextTick ` . You can do ` await wrapper.find('button').trigger('click') `
96
+ setMethods | ⚰️ |
0 commit comments