This unit test
it('should invoke copy method', fakeAsync(() => {
spyOn(testClipboardService, 'copy');
linkEl = fixture.debugElement.query(By.css('.mat-raised-button')).nativeElement;
linkEl.click();
expect(testClipboardService.copy).toHaveBeenCalled();
}));
it successfully passed but in console I have an error which provoked this line:
linkEl.click();
I don't understand why
'ERROR', TypeError{ngDebugContext: DebugContext_{view: Object{def: ..., parent: ..., viewContainerParent: ..., parentNodeDef: ..., context: ..., component: ..., nodes: ..., state: ..., root: ..., renderer: ..., oldValues: ..., disposables: ..., initIndex: ...}, nodeIndex: 0, nodeDef: Object{nodeIndex: ..., parent: ..., renderParent: ..., bindingIndex: ..., outputIndex: ..., checkIndex: ..., flags: ..., childFlags: ..., directChildFlags: ... etc
Thanks in advance