@@ -36,11 +36,10 @@ describe('igxMask', () => {
36
36
IgxMaskModule
37
37
] ,
38
38
providers : [ PlatformUtil ]
39
- } )
40
- . compileComponents ( ) ;
39
+ } ) . compileComponents ( ) ;
41
40
} ) ) ;
42
41
43
- it ( 'Initializes an input with default mask' , fakeAsync ( ( ) => {
42
+ it ( 'Initializes an input with default mask' , ( ) => {
44
43
const fixture = TestBed . createComponent ( DefMaskComponent ) ;
45
44
fixture . detectChanges ( ) ;
46
45
const input = fixture . componentInstance . input ;
@@ -49,18 +48,15 @@ describe('igxMask', () => {
49
48
expect ( input . nativeElement . getAttribute ( 'placeholder' ) ) . toEqual ( 'CCCCCCCCCC' ) ;
50
49
51
50
input . nativeElement . dispatchEvent ( new Event ( 'click' ) ) ;
52
- tick ( ) ;
53
51
54
52
input . nativeElement . value = '@#$YUA123' ;
55
53
fixture . detectChanges ( ) ;
56
54
input . nativeElement . dispatchEvent ( new Event ( 'input' ) ) ;
57
- tick ( ) ;
58
55
59
56
input . nativeElement . dispatchEvent ( new Event ( 'focus' ) ) ;
60
- tick ( ) ;
61
57
62
58
expect ( input . nativeElement . value ) . toEqual ( '@#$YUA123_' ) ;
63
- } ) ) ;
59
+ } ) ;
64
60
65
61
it ( 'Mask rules - digit (0-9) or a space' , fakeAsync ( ( ) => {
66
62
const fixture = TestBed . createComponent ( DigitSpaceMaskComponent ) ;
@@ -391,7 +387,7 @@ describe('igxMask', () => {
391
387
input . nativeElement . dispatchEvent ( new DragEvent ( 'dragleave' ) ) ;
392
388
expect ( input . nativeElement . value ) . toEqual ( '' ) ;
393
389
394
- // should preserve state on dragenter
390
+ // should preserve state on dragenter
395
391
input . nativeElement . dispatchEvent ( new Event ( 'focus' ) ) ;
396
392
UIInteractions . simulatePaste ( '76' , fixture . debugElement . query ( By . css ( '.igx-input-group__input' ) ) , 3 , 3 ) ;
397
393
fixture . detectChanges ( ) ;
@@ -505,19 +501,19 @@ describe('igxMask', () => {
505
501
UIInteractions . simulatePaste ( '1234567890' , inputElement , 1 , 1 ) ;
506
502
fixture . detectChanges ( ) ;
507
503
expect ( inputElement . nativeElement . value ) . toEqual ( '(123) 4567-890' ) ;
508
-
504
+
509
505
const inputHTMLElement = inputElement . nativeElement as HTMLInputElement ;
510
506
inputHTMLElement . setSelectionRange ( 6 , 8 ) ;
511
507
fixture . detectChanges ( ) ;
512
508
expect ( inputElement . nativeElement . selectionStart ) . toEqual ( 6 ) ;
513
509
expect ( inputElement . nativeElement . selectionEnd ) . toEqual ( 8 ) ;
514
510
515
511
UIInteractions . triggerEventHandlerKeyDown ( 'Delete' , inputElement ) ;
516
- inputElement . triggerEventHandler ( 'input' , { inputType : 'test' } ) ;
512
+ inputElement . nativeElement . dispatchEvent ( new Event ( 'input' ) ) ;
517
513
fixture . detectChanges ( ) ;
518
514
expect ( inputElement . nativeElement . selectionStart ) . toEqual ( 8 ) ;
519
515
expect ( inputElement . nativeElement . selectionEnd ) . toEqual ( 8 ) ;
520
- expect ( inputHTMLElement . value ) . toEqual ( '(123) __67-890' ) ;
516
+ expect ( inputHTMLElement . value ) . toEqual ( '(123) __67-890' ) ;
521
517
} ) ;
522
518
} ) ;
523
519
0 commit comments