Skip to content

Commit 46d6c91

Browse files
committed
chore(*): fixing more tests
1 parent 9dea2a0 commit 46d6c91

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('IgxGrid - Cell component #grid', () => {
5555
UIInteractions.simulateClickAndSelectEvent(cellElem);
5656
const args: IGridCellEventArgs = {
5757
cell: firstCell,
58-
event: new Event('mousedown')
58+
event: jasmine.anything() as any
5959
};
6060
fix.detectChanges();
6161

projects/igniteui-angular/src/lib/services/overlay/overlay.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
NgModule,
66
ViewChild,
77
HostBinding,
8-
ApplicationRef
8+
ApplicationRef,
9+
ComponentRef
910
} from '@angular/core';
1011
import { TestBed, fakeAsync, tick, async, inject } from '@angular/core/testing';
1112
import { BrowserModule } from '@angular/platform-browser';
@@ -348,26 +349,26 @@ describe('igxOverlay', () => {
348349

349350
expect(overlayInstance.onOpening.emit).toHaveBeenCalledTimes(1);
350351
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 });
352353
const args: OverlayEventArgs = (overlayInstance.onOpening.emit as jasmine.Spy).calls.mostRecent().args[0];
353354
expect(args.componentRef.instance).toEqual(jasmine.any(SimpleDynamicComponent));
354355
expect(overlayInstance.onAppended.emit).toHaveBeenCalledTimes(1);
355356
expect(overlayInstance.onAnimation.emit).toHaveBeenCalledTimes(1);
356357

357358
tick();
358359
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 });
360361
overlayInstance.hide(firstCallId);
361362

362363
tick();
363364
expect(overlayInstance.onClosing.emit).toHaveBeenCalledTimes(1);
364365
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 });
366367
expect(overlayInstance.onAnimation.emit).toHaveBeenCalledTimes(2);
367368

368369
tick();
369370
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 });
371372

372373
const secondCallId = overlayInstance.show(fix.componentInstance.item);
373374
tick();
@@ -3533,7 +3534,7 @@ describe('igxOverlay', () => {
35333534
expect(overlay.onClosing.emit).toHaveBeenCalledTimes(1);
35343535
expect(overlay.onClosing.emit)
35353536
.toHaveBeenCalledWith({
3536-
id: firstCallId, componentRef: fixture.componentRef, cancel: false,
3537+
id: firstCallId, componentRef: jasmine.any(ComponentRef) as any, cancel: false,
35373538
event: new MouseEvent('click')
35383539
});
35393540
}));

0 commit comments

Comments
 (0)