Skip to content

Commit 2aa84a6

Browse files
committed
fix(mask): error in one of the tests
1 parent d103e81 commit 2aa84a6

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

projects/igniteui-angular/src/lib/directives/mask/mask.directive.spec.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ describe('igxMask', () => {
3636
IgxMaskModule
3737
],
3838
providers: [PlatformUtil]
39-
})
40-
.compileComponents();
39+
}).compileComponents();
4140
}));
4241

43-
it('Initializes an input with default mask', fakeAsync(() => {
42+
it('Initializes an input with default mask', () => {
4443
const fixture = TestBed.createComponent(DefMaskComponent);
4544
fixture.detectChanges();
4645
const input = fixture.componentInstance.input;
@@ -49,18 +48,15 @@ describe('igxMask', () => {
4948
expect(input.nativeElement.getAttribute('placeholder')).toEqual('CCCCCCCCCC');
5049

5150
input.nativeElement.dispatchEvent(new Event('click'));
52-
tick();
5351

5452
input.nativeElement.value = '@#$YUA123';
5553
fixture.detectChanges();
5654
input.nativeElement.dispatchEvent(new Event('input'));
57-
tick();
5855

5956
input.nativeElement.dispatchEvent(new Event('focus'));
60-
tick();
6157

6258
expect(input.nativeElement.value).toEqual('@#$YUA123_');
63-
}));
59+
});
6460

6561
it('Mask rules - digit (0-9) or a space', fakeAsync(() => {
6662
const fixture = TestBed.createComponent(DigitSpaceMaskComponent);
@@ -391,7 +387,7 @@ describe('igxMask', () => {
391387
input.nativeElement.dispatchEvent(new DragEvent('dragleave'));
392388
expect(input.nativeElement.value).toEqual('');
393389

394-
// should preserve state on dragenter
390+
// should preserve state on dragenter
395391
input.nativeElement.dispatchEvent(new Event('focus'));
396392
UIInteractions.simulatePaste('76', fixture.debugElement.query(By.css('.igx-input-group__input')), 3, 3);
397393
fixture.detectChanges();
@@ -505,19 +501,19 @@ describe('igxMask', () => {
505501
UIInteractions.simulatePaste('1234567890', inputElement, 1, 1);
506502
fixture.detectChanges();
507503
expect(inputElement.nativeElement.value).toEqual('(123) 4567-890');
508-
504+
509505
const inputHTMLElement = inputElement.nativeElement as HTMLInputElement;
510506
inputHTMLElement.setSelectionRange(6, 8);
511507
fixture.detectChanges();
512508
expect(inputElement.nativeElement.selectionStart).toEqual(6);
513509
expect(inputElement.nativeElement.selectionEnd).toEqual(8);
514510

515511
UIInteractions.triggerEventHandlerKeyDown('Delete', inputElement);
516-
inputElement.triggerEventHandler('input', { inputType: 'test' });
512+
inputElement.nativeElement.dispatchEvent(new Event('input'));
517513
fixture.detectChanges();
518514
expect(inputElement.nativeElement.selectionStart).toEqual(8);
519515
expect(inputElement.nativeElement.selectionEnd).toEqual(8);
520-
expect(inputHTMLElement.value).toEqual('(123) __67-890');
516+
expect(inputHTMLElement.value).toEqual('(123) __67-890');
521517
});
522518
});
523519

0 commit comments

Comments
 (0)