File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 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 {
699699 `type="radio" /> element. Use wrapper.setChecked() ` +
700700 `instead`
701701 )
702- } else if ( tagName === 'INPUT' || tagName === 'textarea ' ) {
702+ } else if ( tagName === 'INPUT' || tagName === 'TEXTAREA ' ) {
703703 // $FlowIgnore
704704 this . element . value = value
705705 this . trigger ( 'input' )
Original file line number Diff line number Diff line change 44 <input type =" radio" v-model =" radioVal" id =" radioFoo" value =" radioFooResult" >
55 <input type =" radio" v-model =" radioVal" id =" radioBar" value =" radioBarResult" >
66 <input type =" text" v-model =" textVal" >
7+ <textarea v-model =" textareaVal" ></textarea >
78 <select v-model =" selectVal" >
89 <option value =" selectA" ></option >
910 <option value =" selectB" ></option >
3536 return {
3637 checkboxVal: undefined ,
3738 textVal: undefined ,
39+ textareaVal: undefined ,
3840 radioVal: undefined ,
3941 selectVal: undefined ,
4042 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'
22import { describeWithShallowAndMount } from '~resources/utils'
33
44describeWithShallowAndMount ( 'setValue' , mountingMethod => {
5- it ( 'sets element value' , ( ) => {
5+ it ( 'sets element of input value' , ( ) => {
66 const wrapper = mountingMethod ( ComponentWithInput )
77 const input = wrapper . find ( 'input[type="text"]' )
88 input . setValue ( 'foo' )
99
1010 expect ( input . element . value ) . to . equal ( 'foo' )
1111 } )
1212
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+
1321 it ( 'updates dom with v-model' , ( ) => {
1422 const wrapper = mountingMethod ( ComponentWithInput )
1523 const input = wrapper . find ( 'input[type="text"]' )
You can’t perform that action at this time.
0 commit comments