Click is not a function

I need to programmatically click on node.

I try the following code, but it does not work:

public palette: go.Palette = new go.Palette();

const inputEvent = new go.InputEvent();
inputEvent.clickCount = 1;
inputEvent.targetObject = component.myPalette.findNodeForKey('test key');;

I get the following error:

" is not a function"

Tell me how to get around this. I need this in the unit test, in which I need to call event ObjectSingleClicked.

You probably want to use the Robot extension: