@@ -362,4 +362,38 @@ describe('Directive: Mask (Delete)', () => {
362
362
. type ( '{backspace}' . repeat ( 5 ) )
363
363
. should ( 'have.value' , '__:__' ) ;
364
364
} ) ;
365
+
366
+ it ( 'separator with suffix should replace cursor in right place with thousandSeparator ,' , ( ) => {
367
+ cy . mount ( CypressTestMaskComponent , {
368
+ componentProperties : {
369
+ mask : signal ( 'separator.2' ) ,
370
+ suffix : signal ( ' EUR' ) ,
371
+ thousandSeparator : signal ( ',' ) ,
372
+ } ,
373
+ } ) ;
374
+
375
+ cy . get ( '#masked' )
376
+ . type ( '123000' )
377
+ . should ( 'have.value' , '123,000 EUR' )
378
+ . type ( '{leftArrow}' . repeat ( 3 ) )
379
+ . type ( '{backspace}' )
380
+ . should ( 'have.prop' , 'selectionStart' , 3 ) ;
381
+ } ) ;
382
+
383
+ it ( 'separator with suffix should replace cursor in right place with thousandSeparator .' , ( ) => {
384
+ cy . mount ( CypressTestMaskComponent , {
385
+ componentProperties : {
386
+ mask : signal ( 'separator.2' ) ,
387
+ suffix : signal ( ' EUR' ) ,
388
+ thousandSeparator : signal ( '.' ) ,
389
+ } ,
390
+ } ) ;
391
+
392
+ cy . get ( '#masked' )
393
+ . type ( '123000' )
394
+ . should ( 'have.value' , '123.000 EUR' )
395
+ . type ( '{leftArrow}' . repeat ( 3 ) )
396
+ . type ( '{backspace}' )
397
+ . should ( 'have.prop' , 'selectionStart' , 3 ) ;
398
+ } ) ;
365
399
} ) ;
0 commit comments