@@ -213,19 +213,23 @@ test('Leading static characters', function(t) {
213213} )
214214
215215test ( 'Providing a custom placeholder character' , function ( t ) {
216- t . plan ( 4 )
216+ t . plan ( 5 )
217217
218218 var mask = new InputMask ( { pattern : '---- 1111' , placeholderChar : ' ' } )
219219 mask . selection = { start : 0 , end : 15 }
220220 t . true ( mask . input ( '3' ) , 'Valid input accepted with custom placeholderChar' )
221221 t . equal ( mask . getValue ( ) , '---- 3 ' ,
222222 'Value applied to the first editable char with custom placeholderChar' )
223223 t . throws ( function ( ) { new InputMask ( { pattern : '--11' , placeholderChar : '__' } ) } ,
224- / I n p u t M a s k : p l a c e h o l d e r C h a r s h o u l d b e a s i n g l e c h a r a c t e r / ,
224+ / I n p u t M a s k : p l a c e h o l d e r C h a r s h o u l d b e a s i n g l e c h a r a c t e r o r a n e m p t y s t r i n g . / ,
225225 'placholderChar length > 1 is invalid' )
226- t . throws ( function ( ) { new InputMask ( { pattern : '--11' , placeholderChar : '' } ) } ,
227- / I n p u t M a s k : p l a c e h o l d e r C h a r s h o u l d b e a s i n g l e c h a r a c t e r / ,
228- 'placholderChar length < 1 is invalid' )
226+
227+ // With an empty string as the placeholderChar
228+ mask = new InputMask ( { pattern : '---- 1111' , placeholderChar : '' } )
229+ mask . selection = { start : 0 , end : 15 }
230+ t . true ( mask . input ( '3' ) , 'Valid input accepted with empty string placeholderChar' )
231+ t . equal ( mask . getValue ( ) , '---- 3' ,
232+ 'Value applied to the first editable char with empty string placeholderChar' )
229233 t . end ( )
230234} )
231235
0 commit comments