Skip to content

Commit d9ad49c

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Adding test.
1 parent b612598 commit d9ad49c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,19 @@ describe('IgxForOf directive -', () => {
256256
}
257257
});
258258

259+
it('should not throw error when itemSize is changed while data is null/undefined.', () => {
260+
let errorMessage = '';
261+
fix.componentInstance.data = null;
262+
fix.detectChanges();
263+
try {
264+
fix.componentInstance.itemSize = '100px';
265+
fix.detectChanges();
266+
} catch (ex) {
267+
errorMessage = ex.message;
268+
}
269+
expect(errorMessage).toBe('');
270+
});
271+
259272
it('should allow initially undefined value for igxForOf and then detect changes correctly once the value is updated', async () => {
260273
fix = TestBed.createComponent(VerticalVirtualNoDataComponent);
261274
expect(() => {

0 commit comments

Comments
 (0)