File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 170
170
}
171
171
172
172
else {
173
- ttEach ( this , function ( t ) { t . setVal ( newVal ) ; } ) ;
173
+ ttEach ( this , function ( t ) { t . setVal ( _ . toStr ( newVal ) ) ; } ) ;
174
174
return this ;
175
175
}
176
176
} ,
Original file line number Diff line number Diff line change @@ -157,6 +157,14 @@ describe('$plugin', function() {
157
157
expect ( this . $input . typeahead ( 'val' ) ) . toBe ( 'foo' ) ;
158
158
} ) ;
159
159
160
+ it ( '#val(q) should coerce null and undefined to empty string' , function ( ) {
161
+ this . $input . typeahead ( 'val' , null ) ;
162
+ expect ( this . $input . typeahead ( 'val' ) ) . toBe ( '' ) ;
163
+
164
+ this . $input . typeahead ( 'val' , undefined ) ;
165
+ expect ( this . $input . typeahead ( 'val' ) ) . toBe ( '' ) ;
166
+ } ) ;
167
+
160
168
it ( '#destroy should revert modified attributes' , function ( ) {
161
169
expect ( this . $input ) . toHaveAttr ( 'autocomplete' , 'off' ) ;
162
170
expect ( this . $input ) . toHaveAttr ( 'dir' ) ;
You can’t perform that action at this time.
0 commit comments