I have the following variable in file Test.ts
@state()
public controller? = new Editor(this);
In one of the functions handleAssetClick in Test.ts I call the function controller.closeEditor() which is an asynchronous function
await controller.closeEditor()
I am trying to write a test for Test.ts. How do I stub closeEditor so that I can write a unit test for handleAssetClick to test whether it calls dispatchEvent. Here’s the code for handleAssetClick in Test.ts
private handleAssetClick() {
await controller.closeEditor();
this.dispatchEvent("event-name");
}