File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -699,7 +699,7 @@ export default class Wrapper implements BaseWrapper {
699
699
`type="radio" /> element. Use wrapper.setChecked() ` +
700
700
`instead`
701
701
)
702
- } else if ( tagName === 'INPUT' || tagName === 'textarea ' ) {
702
+ } else if ( tagName === 'INPUT' || tagName === 'TEXTAREA ' ) {
703
703
// $FlowIgnore
704
704
this . element . value = value
705
705
this . trigger ( 'input' )
Original file line number Diff line number Diff line change 4
4
<input type =" radio" v-model =" radioVal" id =" radioFoo" value =" radioFooResult" >
5
5
<input type =" radio" v-model =" radioVal" id =" radioBar" value =" radioBarResult" >
6
6
<input type =" text" v-model =" textVal" >
7
+ <textarea v-model =" textareaVal" ></textarea >
7
8
<select v-model =" selectVal" >
8
9
<option value =" selectA" ></option >
9
10
<option value =" selectB" ></option >
35
36
return {
36
37
checkboxVal: undefined ,
37
38
textVal: undefined ,
39
+ textareaVal: undefined ,
38
40
radioVal: undefined ,
39
41
selectVal: undefined ,
40
42
counter: 0
Original file line number Diff line number Diff line change @@ -2,14 +2,22 @@ import ComponentWithInput from '~resources/components/component-with-input.vue'
2
2
import { describeWithShallowAndMount } from '~resources/utils'
3
3
4
4
describeWithShallowAndMount ( 'setValue' , mountingMethod => {
5
- it ( 'sets element value' , ( ) => {
5
+ it ( 'sets element of input value' , ( ) => {
6
6
const wrapper = mountingMethod ( ComponentWithInput )
7
7
const input = wrapper . find ( 'input[type="text"]' )
8
8
input . setValue ( 'foo' )
9
9
10
10
expect ( input . element . value ) . to . equal ( 'foo' )
11
11
} )
12
12
13
+ it ( 'sets element of textarea value' , ( ) => {
14
+ const wrapper = mountingMethod ( ComponentWithInput )
15
+ const textarea = wrapper . find ( 'textarea' )
16
+ textarea . setValue ( 'foo' )
17
+
18
+ expect ( textarea . element . value ) . to . equal ( 'foo' )
19
+ } )
20
+
13
21
it ( 'updates dom with v-model' , ( ) => {
14
22
const wrapper = mountingMethod ( ComponentWithInput )
15
23
const input = wrapper . find ( 'input[type="text"]' )
You can’t perform that action at this time.
0 commit comments