-
Notifications
You must be signed in to change notification settings - Fork 137
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
fixture.detectChanges() doesn't play well with <ionic-content> #175
Comments
Well, I think this was just my own naive approach to blindly using your mock objects. When I used the real ionic 'App' and 'Platform' instead of the mocks the problem went away. You can close the issue if you want. Otherwise I guess the solution is to come up with more elegant mock objects for some of the ionic components. |
Oddly enough I can't replicate this against this repo, but I found the exact same thing on my closed source project a couple of hours before you raised this. Regarding the mocks:
I tried to remove the ConfigMock, which should be the last one remaining, but I ran into this:
Presumably because it isn't loading / reading in the config properly. |
For an ionic2 Page component I am trying to use fixture.detectChanges() (or even the autodetect method) in my tests to run the angular2 lifecycle hooks but I keep running into an error. If I remove any tags from my html the error goes away so it seems very specific to ionic.
The workaround is to only do lifecycle unit tests on angular components that do not have but I am hoping there is a more permanent solution.
BTW: Great example of unit testing with ionic2. Thank you!
Error Message:
To Reproduce
I started with a fresh clone of your repo and then added the following test to src/pages/clickerList/clickerList.spec.ts:
The text was updated successfully, but these errors were encountered: