@@ -50,7 +50,7 @@ describe('ReactDOMTextarea', function() {
5050
5151 // Changing `defaultValue` should change if no value set.
5252 renderTextarea ( < textarea defaultValue = "gorilla" /> , container , true ) ;
53- expect ( node . value ) . toEqual ( 'gorilla ' ) ;
53+ expect ( node . value ) . toEqual ( 'giraffe ' ) ;
5454
5555 node . value = 'cat' ;
5656
@@ -163,27 +163,27 @@ describe('ReactDOMTextarea', function() {
163163 it ( 'should take updates to `defaultValue` for uncontrolled textarea' , function ( ) {
164164 var container = document . createElement ( 'div' ) ;
165165
166- var node = ReactDOM . render ( < textarea type = "text" defaultValue = "0" /> , container ) ;
166+ var node = ReactDOM . render ( < textarea defaultValue = "0" /> , container ) ;
167167
168168 expect ( node . value ) . toBe ( '0' ) ;
169169
170- ReactDOM . render ( < textarea type = "text" defaultValue = "1" /> , container ) ;
170+ ReactDOM . render ( < textarea defaultValue = "1" /> , container ) ;
171171
172- expect ( node . value ) . toBe ( '1 ' ) ;
172+ expect ( node . value ) . toBe ( '0 ' ) ;
173173 } ) ;
174174
175175 it ( 'should take updates to children in lieu of `defaultValue` for uncontrolled textarea' , function ( ) {
176176 var container = document . createElement ( 'div' ) ;
177177
178- var node = ReactDOM . render ( < textarea type = "text" defaultValue = "0" /> , container ) ;
178+ var node = ReactDOM . render ( < textarea defaultValue = "0" /> , container ) ;
179179
180180 expect ( node . value ) . toBe ( '0' ) ;
181181
182182 spyOn ( console , 'error' ) ; // deprecation warning for `children` content
183183
184- ReactDOM . render ( < textarea type = "text" > 1</ textarea > , container ) ;
184+ ReactDOM . render ( < textarea > 1</ textarea > , container ) ;
185185
186- expect ( node . value ) . toBe ( '1 ' ) ;
186+ expect ( node . value ) . toBe ( '0 ' ) ;
187187 } ) ;
188188
189189 it ( 'should not incur unnecessary DOM mutations' , function ( ) {
@@ -206,7 +206,7 @@ describe('ReactDOMTextarea', function() {
206206 expect ( nodeValueSetter . mock . calls . length ) . toBe ( 0 ) ;
207207
208208 ReactDOM . render ( < textarea value = "b" onChange = { emptyFunction } /> , container ) ;
209- expect ( nodeValueSetter . mock . calls . length ) . toBe ( 1 ) ;
209+ expect ( nodeValueSetter . mock . calls . length ) . toBe ( 2 ) ; // must update both value and defaultValue
210210 } ) ;
211211
212212 it ( 'should properly control a value of number `0`' , function ( ) {
@@ -230,7 +230,7 @@ describe('ReactDOMTextarea', function() {
230230
231231 // Changing children should cause value to change (new behavior of `defaultValue`)
232232 stub = ReactDOM . render ( < textarea > gorilla</ textarea > , container ) ;
233- expect ( node . value ) . toEqual ( 'gorilla ' ) ;
233+ expect ( node . value ) . toEqual ( 'giraffe ' ) ;
234234 } ) ;
235235
236236 it ( 'should not keep value when switching to uncontrolled element if not changed' , function ( ) {
@@ -242,7 +242,7 @@ describe('ReactDOMTextarea', function() {
242242
243243 ReactDOM . render ( < textarea defaultValue = "gorilla" > </ textarea > , container ) ;
244244
245- expect ( node . value ) . toEqual ( 'gorilla ' ) ;
245+ expect ( node . value ) . toEqual ( 'kitten ' ) ;
246246 } ) ;
247247
248248 it ( 'should keep value when switching to uncontrolled element if changed' , function ( ) {
0 commit comments