Here's my code:
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(componentClass);
const dialogElement = document.createElement('some-dialog');
const componentRef = componentFactory.create(
this.injector,
[],
dialogElement
);
document.body.appendChild(dialogElement);
This code is happening inside a service. Now, I'd like to grab the instance of the component (componentRef) from inside a test file. How can this be done, considering all I have in the test is the DOM element?