How do I render a template that is not wrapped by a component or a directive? #6751
Replies: 2 comments
-
i'm having a similar issue, i'm trying to test a component similar to the example bellow. But this doesn't appear possible with-in ng-mock because, as is mentioned in the above post, render requires that the component to be a mock. Or more specifically to have the __mock flag set. ( I'm curious what the use of ngMocks.render is if not to render a template in the component under test? ) In this case this example if from testing the content of an ng-boostrap
Is there any kind of work around for testing a component like above with-in ng-mock @satanTime ? |
Beta Was this translation helpful? Give feedback.
-
So I was trying to find a way to do that using NgMocks and I completely forgot I don't need an abstraction around it. Once we have a template reference, using |
Beta Was this translation helpful? Give feedback.
-
Here is a simplified version of a component I'm trying to test.
I would like to render the content of that template. But all the examples show how to do that when the template is inside a child component or a directive. The
render
method requires a mocked component instance as the first param.Any ideas?
Here's a stackblitz demostrating the problem
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions