@@ -67,23 +67,23 @@ describe('Actions.vue', () => {
67
67
68
68
it (' calls store action actionInput when input value is input and an input even is fired' , () => {
69
69
const wrapper = mount (Actions, { store })
70
- const input = wrapper .find (' input' )[ 0 ]
70
+ const input = wrapper .find (' input' )
71
71
input .element .value = ' input'
72
72
input .trigger (' input' )
73
73
expect (actions .actionInput .calledOnce ).toBe (true )
74
74
})
75
75
76
76
it (' does not call store action actionInput when input value is not input and an input even is fired' , () => {
77
77
const wrapper = mount (Actions, { store })
78
- const input = wrapper .find (' input' )[ 0 ]
78
+ const input = wrapper .find (' input' )
79
79
input .element .value = ' not input'
80
80
input .trigger (' input' )
81
81
expect (actions .actionInput .calledOnce ).toBe (false )
82
82
})
83
83
84
84
it (' calls store action actionClick when button is clicked' , () => {
85
85
const wrapper = mount (Actions, { store })
86
- wrapper .find (' button' )[ 0 ] .trigger (' click' )
86
+ wrapper .find (' button' ).trigger (' click' )
87
87
expect (actions .actionClick .calledOnce ).toBe (true )
88
88
})
89
89
})
@@ -159,13 +159,13 @@ describe('Getters.vue', () => {
159
159
160
160
it (' Renders state.inputValue in first p tag' , () => {
161
161
const wrapper = mount (Actions, { store })
162
- const p = wrapper .find (' p' )[ 0 ]
162
+ const p = wrapper .find (' p' )
163
163
expect (p .text ()).toBe (getters .inputValue ())
164
164
})
165
165
166
166
it (' Renders state.clicks in second p tag' , () => {
167
167
const wrapper = mount (Actions, { store })
168
- const p = wrapper .find (' p' )[ 1 ]
168
+ const p = wrapper .findAll (' p' ). at ( 1 )
169
169
expect (p .text ()).toBe (getters .clicks ().toString ())
170
170
})
171
171
})
@@ -245,14 +245,14 @@ describe('Modules.vue', () => {
245
245
246
246
it (' calls store action moduleActionClick when button is clicked' , () => {
247
247
const wrapper = mount (Modules, { store })
248
- const button = wrapper .find (' button' )[ 0 ]
248
+ const button = wrapper .find (' button' )
249
249
button .trigger (' click' )
250
250
expect (actions .moduleActionClick .calledOnce ).toBe (true )
251
251
})
252
252
253
253
it (' Renders state.inputValue in first p tag' , () => {
254
254
const wrapper = mount (Modules, { store })
255
- const p = wrapper .find (' p' )[ 0 ]
255
+ const p = wrapper .find (' p' )
256
256
expect (p .text ()).toBe (state .module .clicks .toString ())
257
257
})
258
258
})
0 commit comments