Skip to content

Commit 30f1e33

Browse files
test(igxMask): detect changes every time value is set #6454
1 parent df6a6c9 commit 30f1e33

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { IgxInputGroupModule } from '../../input-group/input-group.component';
1010
import { IgxMaskModule } from './mask.directive';
1111

1212
import { configureTestSuite } from '../../test-utils/configure-suite';
13+
import { UIInteractions } from '../../test-utils/ui-interactions.spec';
1314

1415
describe('igxMask', () => {
1516
configureTestSuite();
@@ -41,7 +42,6 @@ describe('igxMask', () => {
4142
it('Initializes an input with default mask', fakeAsync(() => {
4243
const fixture = TestBed.createComponent(DefMaskComponent);
4344
fixture.detectChanges();
44-
4545
const input = fixture.componentInstance.input;
4646

4747
expect(input.nativeElement.value).toEqual('');
@@ -51,6 +51,7 @@ describe('igxMask', () => {
5151
tick();
5252

5353
input.nativeElement.value = '@#$YUA123';
54+
fixture.detectChanges();
5455
input.nativeElement.dispatchEvent(new Event('input'));
5556
tick();
5657

@@ -149,13 +150,13 @@ describe('igxMask', () => {
149150
it('Enter incorrect value with a preset mask', fakeAsync(() => {
150151
const fixture = TestBed.createComponent(MaskComponent);
151152
fixture.detectChanges();
152-
153153
const input = fixture.componentInstance.input;
154154

155155
input.nativeElement.dispatchEvent(new Event('focus'));
156156
tick();
157157

158158
input.nativeElement.value = 'abc4569d12';
159+
fixture.detectChanges();
159160
input.nativeElement.dispatchEvent(new Event('input'));
160161
tick();
161162

@@ -168,6 +169,7 @@ describe('igxMask', () => {
168169
tick();
169170

170171
input.nativeElement.value = '1111111111111111111';
172+
fixture.detectChanges();
171173
input.nativeElement.dispatchEvent(new Event('input'));
172174
tick();
173175

@@ -199,6 +201,7 @@ describe('igxMask', () => {
199201
tick();
200202

201203
input.nativeElement.value = '123';
204+
fixture.detectChanges();
202205
input.nativeElement.dispatchEvent(new Event('input'));
203206
tick();
204207

@@ -225,6 +228,7 @@ describe('igxMask', () => {
225228
expect(comp.value).toEqual(3456);
226229

227230
input.nativeElement.value = 'A';
231+
fixture.detectChanges();
228232
input.nativeElement.dispatchEvent(new Event('input'));
229233
tick();
230234

@@ -277,6 +281,7 @@ describe('igxMask', () => {
277281
tick();
278282

279283
input.nativeElement.value = '';
284+
fixture.detectChanges();
280285
input.nativeElement.dispatchEvent(new Event('input'));
281286
tick();
282287

@@ -286,6 +291,7 @@ describe('igxMask', () => {
286291
expect(input.nativeElement.value).toEqual('(___) ____-___');
287292

288293
input.nativeElement.value = '6666';
294+
fixture.detectChanges();
289295
input.nativeElement.dispatchEvent(new Event('input'));
290296
tick();
291297

0 commit comments

Comments
 (0)