-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(docs): trigger a detect changes inside the constructor ? #33
Comments
Hi Kevin. Glad you like speculoos! You got it right. You indeed need a first call to We didn't call it by default in the ComponentTester constructor because some component templates can only work once inputs have been set on the component, so it's up to the user to decide when the tester is ready and thus when its view can be rendered for the first time. Imagine some component with a template like the following:
Where If the ComponentTester constructor called
or, if you prefer doing that outside of the constructor because you want different tests with different inputs:
I hope it clarifies things. Now, I understand your concern about the lack of documentation about this, and I'll try making things clearer. |
Hi,
First of all (and like the last time I saw you), thanks for the job done inside the pro pack and for this libs (and valdemort too).
I'm currently writing slides for VoxxedDays Luxembourg and I think this lib is a must have for me in my presentation. But I'm currently trying to replace the default test written by the CLI with some using the
ComponentTester
But, I think a complete example project is something missing in this repository.
Examples in compodoc are a bit too short and some
...
hide things not trivial for everyone.In my case, I had to use the method
detectChanges()
. Without this call, the component template doesn't have its text bindings initialised.So, without this
detectChanges()
, I have this error:For a very simple component :
With template :
So, I would like to know if this is a correct way to use the
ComponentTester<T>
in this kind of test ?/cc @Neonox31 @dabbid @Yann29
The text was updated successfully, but these errors were encountered: