Skip to content

Commit dc57672

Browse files
committed
chore(*): adding jasmine allowRespy(true)
1 parent b8190cc commit dc57672

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid-row-editing.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ describe('IgxGrid - Row Editing #grid', () => {
7272
});
7373

7474
it('Should throw a warning when [rowEditable] is set on a grid w/o [primaryKey]', () => {
75+
jasmine.getEnv().allowRespy(true);
7576
grid.primaryKey = null;
7677
grid.rowEditable = false;
7778
fix.detectChanges();
@@ -88,6 +89,7 @@ describe('IgxGrid - Row Editing #grid', () => {
8889
fix.detectChanges();
8990
expect(console.warn).toHaveBeenCalledWith('The grid must have a `primaryKey` specified when using `rowEditable`!');
9091
expect(console.warn).toHaveBeenCalledTimes(1);
92+
jasmine.getEnv().allowRespy(false);
9193
});
9294

9395
it('Should be able to enter edit mode on dblclick, enter and f2', () => {

projects/igniteui-angular/src/lib/grids/grid/grid.component.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ describe('IgxGrid Component Tests #grid', () => {
673673
});
674674

675675
it('should throw a warning when primaryKey is set to a non-existing data field', () => {
676+
jasmine.getEnv().allowRespy(true);
676677
const warnSpy = spyOn(console, 'warn');
677678
const fixture = TestBed.createComponent(IgxGridTestComponent);
678679
const grid = fixture.componentInstance.grid;
@@ -700,6 +701,7 @@ describe('IgxGrid Component Tests #grid', () => {
700701
expect(console.warn).toHaveBeenCalledWith(
701702
`Field "${grid.primaryKey}" is not defined in the data. Set \`primaryKey\` to a valid field.`
702703
);
704+
jasmine.getEnv().allowRespy(false);
703705
});
704706
});
705707

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
637637
});
638638

639639
it('should throw a warning when primaryKey is set to a non-existing data field', () => {
640+
jasmine.getEnv().allowRespy(true);
640641
spyOn(console, 'warn');
641642
hierarchicalGrid.primaryKey = 'testField';
642643
fixture.componentInstance.rowIsland.primaryKey = 'testField-rowIsland';
@@ -665,6 +666,7 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
665666
expect(console.warn).toHaveBeenCalledWith(
666667
`Field "${rowIsland.primaryKey}" is not defined in the data. Set \`primaryKey\` to a valid field.`
667668
);
669+
jasmine.getEnv().allowRespy(false);
668670
});
669671
});
670672

projects/igniteui-angular/src/lib/stepper/stepper.component.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const getStepperPositions = (): string[] => {
5151
return positions;
5252
};
5353

54-
const testAnimationBehvior = (
54+
const testAnimationBehavior = (
5555
val: any,
5656
fix: ComponentFixture<IgxStepperSampleTestComponent>,
5757
isHorAnimTypeInvalidTest: boolean
@@ -570,7 +570,7 @@ describe('Rendering Tests', () => {
570570

571571
for (const val of numericTestValues) {
572572
fix.componentInstance.animationDuration = val as any;
573-
testAnimationBehvior(val, fix, false);
573+
testAnimationBehavior(val, fix, false);
574574
}
575575

576576
const fallbackToDefaultValues = [-1, 0, null, undefined, 'sampleString', [], {}];
@@ -579,7 +579,7 @@ describe('Rendering Tests', () => {
579579
fix.detectChanges();
580580
expect(stepper.animationDuration)
581581
.toBe((stepper as any)._defaultAnimationDuration);
582-
testAnimationBehvior(val, fix, false);
582+
testAnimationBehavior(val, fix, false);
583583
}
584584

585585
fix.componentInstance.animationDuration = 300;
@@ -589,13 +589,13 @@ describe('Rendering Tests', () => {
589589
const horAnimTypeValidValues = ['slide', 'fade', 'none'];
590590
for (const val of horAnimTypeValidValues) {
591591
fix.componentInstance.horizontalAnimationType = val as any;
592-
testAnimationBehvior(val, fix, false);
592+
testAnimationBehavior(val, fix, false);
593593
}
594594

595595
const horAnimTypeTestValues = ['sampleString', null, undefined, 0, [], {}];
596596
for (const val of horAnimTypeTestValues) {
597597
fix.componentInstance.horizontalAnimationType = val as any;
598-
testAnimationBehvior(val, fix, true);
598+
testAnimationBehavior(val, fix, true);
599599
}
600600

601601
stepper.orientation = IgxStepperOrientation.Vertical;
@@ -604,7 +604,7 @@ describe('Rendering Tests', () => {
604604
const vertAnimTypeTestValues = ['fade', 'grow', 'none', 'sampleString', null, undefined, 0, [], {}];
605605
for (const val of vertAnimTypeTestValues) {
606606
fix.componentInstance.verticalAnimationType = val as any;
607-
testAnimationBehvior(val, fix, false);
607+
testAnimationBehavior(val, fix, false);
608608
}
609609
}));
610610

@@ -710,7 +710,7 @@ describe('Rendering Tests', () => {
710710
it('should properly collapse the previously active step in horizontal orientation and animation type \'fade\'', fakeAsync(() => {
711711
stepper.orientation = IgxStepperOrientation.Horizontal;
712712
stepper.horizontalAnimationType = 'fade';
713-
testAnimationBehvior('fade', fix, false);
713+
testAnimationBehavior('fade', fix, false);
714714
}));
715715
});
716716

0 commit comments

Comments
 (0)