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');
myPalette.click(inputEvent);

I get the following error:

"palette.click 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: https://gojs.net/latest/extensions/Robot.html