Skip to content
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

Unit test @Pages #41

Closed
lathonez opened this issue Mar 9, 2016 · 12 comments
Closed

Unit test @Pages #41

lathonez opened this issue Mar 9, 2016 · 12 comments

Comments

@lathonez
Copy link
Owner

lathonez commented Mar 9, 2016

Similar to the component tests, we should be testing @Pages properly using DI so we can inspect the DOM during the tests.

@bengro
Copy link

bengro commented Mar 17, 2016

What exactly is this issue addressing? I bumped into the issue that when testing implementation using the @page annotation, systemjs could not resolve the dependency for the Page method properly. More concretely, when importing the page class (annotated with @page), Zone.run would throw something along the lines "ionic_angular_1.Page is not a function". This github issue might be related. If so, I would be very much interested in solving it.

@lathonez
Copy link
Owner Author

@bengro - exactly, I've got it up and running in another project, will try to add something quickly..

@bengro
Copy link

bengro commented Mar 17, 2016

That would be most splendid! If I can do something to speed things up, let me know. I'm assuming the problem is the transpilation/systemjs? I'm keen on seeing how you solved the problem. My first step would have been to find out how @component does it.

Thanks a bunch @lathonez!

@lathonez
Copy link
Owner Author

@page is the same as @component with more dependencies

65bf5d5

I've set up the skeleton for the ClickerList @page. This should give you access to the 'clickerListComponentFixture' variable, through which you can get the page DOM.

I found this blog really useful when I set it up for @components in the first place.

@bengro
Copy link

bengro commented Mar 17, 2016

Very helpful, thank you.

@ciekawy
Copy link

ciekawy commented Apr 9, 2016

slightly OT, how does current gulpfile/webpack corresponds to previous test config? does it still execute tests or needs to be reenabled?

@lathonez
Copy link
Owner Author

Sorry, could you elaborate a little?

@ciekawy
Copy link

ciekawy commented Apr 11, 2016

I've found an answer. I haven't noticed dedicated gulpfile for tests and github diff showing only the differences :) On my project I've managed to easily merge the gulpfile used only for testing with the new one generated by recent ionic cli.

@lathonez
Copy link
Owner Author

Cool. I wanted to keep the testing one separate to make things more obvious, particularly as the main one is maintained by Ionic. As you say they are easily merged.

@lathonez lathonez reopened this Apr 13, 2016
@lathonez
Copy link
Owner Author

Didn't mean to close

@fmsouza
Copy link

fmsouza commented Jun 14, 2016

Within [email protected] the @Page decorator was deprecated. Now there's only the @Component decorator for this purpose.

@lathonez
Copy link
Owner Author

@fmsouza yup. I guess this issue is basically dead now. I still feel that there could be more examples of DOM testing components in this project, but we really need more complicated pages (#44 / #45) in order to address that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants