@@ -51,6 +51,13 @@ describe('ReactDOMTextarea', function() {
51
51
expect ( node . value ) . toEqual ( 'giraffe' ) ;
52
52
} ) ;
53
53
54
+ it ( 'should display `defaultValue` of number 0' , function ( ) {
55
+ var stub = < textarea defaultValue = { 0 } /> ;
56
+ var node = renderTextarea ( stub ) ;
57
+
58
+ expect ( node . value ) . toBe ( '0' ) ;
59
+ } ) ;
60
+
54
61
it ( 'should allow setting `value`' , function ( ) {
55
62
var stub = < textarea value = "giraffe" /> ;
56
63
var node = renderTextarea ( stub ) ;
@@ -61,6 +68,13 @@ describe('ReactDOMTextarea', function() {
61
68
expect ( node . value ) . toEqual ( 'gorilla' ) ;
62
69
} ) ;
63
70
71
+ it ( 'should display `value` of number 0' , function ( ) {
72
+ var stub = < textarea value = { 0 } /> ;
73
+ var node = renderTextarea ( stub ) ;
74
+
75
+ expect ( node . value ) . toBe ( '0' ) ;
76
+ } ) ;
77
+
64
78
it ( 'should treat children like `defaultValue`' , function ( ) {
65
79
spyOn ( console , 'warn' ) ;
66
80
@@ -102,3 +116,36 @@ describe('ReactDOMTextarea', function() {
102
116
expect ( console . warn . argsForCall . length ) . toBe ( 2 ) ;
103
117
} ) ;
104
118
} ) ;
119
+
120
+ describe ( 'ReactDOMInput' , function ( ) {
121
+ var React ;
122
+ var ReactTestUtils ;
123
+
124
+ var renderTextarea ;
125
+
126
+ beforeEach ( function ( ) {
127
+ React = require ( 'React' ) ;
128
+ ReactTestUtils = require ( 'ReactTestUtils' ) ;
129
+
130
+ renderTextarea = function ( component ) {
131
+ var stub = ReactTestUtils . renderIntoDocument ( component ) ;
132
+ var node = stub . getDOMNode ( ) ;
133
+ return node ;
134
+ } ;
135
+ } ) ;
136
+
137
+ it ( 'should display `defaultValue` of number 0' , function ( ) {
138
+ var stub = < input type = "text" defaultValue = { 0 } /> ;
139
+ var node = renderTextarea ( stub ) ;
140
+
141
+ expect ( node . value ) . toBe ( '0' ) ;
142
+ } ) ;
143
+
144
+ it ( 'should display `value` of number 0' , function ( ) {
145
+ var stub = < input type = "text" value = { 0 } /> ;
146
+ var node = renderTextarea ( stub ) ;
147
+
148
+ expect ( node . value ) . toBe ( '0' ) ;
149
+ } ) ;
150
+
151
+ } ) ;
0 commit comments