|
5 | 5 | NgModule, |
6 | 6 | ViewChild, |
7 | 7 | HostBinding, |
8 | | - ApplicationRef |
| 8 | + ApplicationRef, |
| 9 | + ComponentRef |
9 | 10 | } from '@angular/core'; |
10 | 11 | import { TestBed, fakeAsync, tick, async, inject } from '@angular/core/testing'; |
11 | 12 | import { BrowserModule } from '@angular/platform-browser'; |
@@ -348,26 +349,26 @@ describe('igxOverlay', () => { |
348 | 349 |
|
349 | 350 | expect(overlayInstance.onOpening.emit).toHaveBeenCalledTimes(1); |
350 | 351 | expect(overlayInstance.onOpening.emit) |
351 | | - .toHaveBeenCalledWith({ id: firstCallId, componentRef: fix.componentRef, cancel: false }); |
| 352 | + .toHaveBeenCalledWith({ id: firstCallId, componentRef: jasmine.any(ComponentRef) as any, cancel: false }); |
352 | 353 | const args: OverlayEventArgs = (overlayInstance.onOpening.emit as jasmine.Spy).calls.mostRecent().args[0]; |
353 | 354 | expect(args.componentRef.instance).toEqual(jasmine.any(SimpleDynamicComponent)); |
354 | 355 | expect(overlayInstance.onAppended.emit).toHaveBeenCalledTimes(1); |
355 | 356 | expect(overlayInstance.onAnimation.emit).toHaveBeenCalledTimes(1); |
356 | 357 |
|
357 | 358 | tick(); |
358 | 359 | expect(overlayInstance.onOpened.emit).toHaveBeenCalledTimes(1); |
359 | | - expect(overlayInstance.onOpened.emit).toHaveBeenCalledWith({ id: firstCallId, componentRef: fix.componentRef }); |
| 360 | + expect(overlayInstance.onOpened.emit).toHaveBeenCalledWith({ id: firstCallId, componentRef: jasmine.any(ComponentRef) as any }); |
360 | 361 | overlayInstance.hide(firstCallId); |
361 | 362 |
|
362 | 363 | tick(); |
363 | 364 | expect(overlayInstance.onClosing.emit).toHaveBeenCalledTimes(1); |
364 | 365 | expect(overlayInstance.onClosing.emit) |
365 | | - .toHaveBeenCalledWith({ id: firstCallId, componentRef: fix.componentRef, cancel: false, event: undefined }); |
| 366 | + .toHaveBeenCalledWith({ id: firstCallId, componentRef: jasmine.any(ComponentRef) as any, cancel: false, event: undefined }); |
366 | 367 | expect(overlayInstance.onAnimation.emit).toHaveBeenCalledTimes(2); |
367 | 368 |
|
368 | 369 | tick(); |
369 | 370 | expect(overlayInstance.onClosed.emit).toHaveBeenCalledTimes(1); |
370 | | - expect(overlayInstance.onClosed.emit).toHaveBeenCalledWith({ id: firstCallId, componentRef: fix.componentRef }); |
| 371 | + expect(overlayInstance.onClosed.emit).toHaveBeenCalledWith({ id: firstCallId, componentRef: jasmine.any(ComponentRef) as any }); |
371 | 372 |
|
372 | 373 | const secondCallId = overlayInstance.show(fix.componentInstance.item); |
373 | 374 | tick(); |
@@ -3533,7 +3534,7 @@ describe('igxOverlay', () => { |
3533 | 3534 | expect(overlay.onClosing.emit).toHaveBeenCalledTimes(1); |
3534 | 3535 | expect(overlay.onClosing.emit) |
3535 | 3536 | .toHaveBeenCalledWith({ |
3536 | | - id: firstCallId, componentRef: fixture.componentRef, cancel: false, |
| 3537 | + id: firstCallId, componentRef: jasmine.any(ComponentRef) as any, cancel: false, |
3537 | 3538 | event: new MouseEvent('click') |
3538 | 3539 | }); |
3539 | 3540 | })); |
|
0 commit comments