-
Notifications
You must be signed in to change notification settings - Fork 136
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
Testing fails when template contains ngModel #108
Comments
Does #100 help you? |
You mean replacing [(ngModel)]=foo with just ngModel=foo or using ngControl=foo instead? |
(ngControl)=foo Seemed to work in #100 On 28 Jun 2016 21:23, "chrono" [email protected] wrote:
|
Ouh... beta10 was just released. I'll try to merge your latest changes and the new DI boilerplate (however that may work) into my codebase and will try with (ngControl)=foo even though it's not technically a form: https://github.com/apollo-ng/governess/blob/master/governess-app/app/pages/tasks/tasks.html |
Agreed it looks wrong. I just followed that stack overflow through which Let me know what you end up going with. It's my Ionic day tomorrow so I'll probably upgrade to beta10. On 28 Jun 2016 21:46, "chrono" [email protected] wrote:
|
I've also upgraded to beta10 and will merge your changes tonight and then test again. |
To replicate, you can add anything with an
You'll get the error when initializing the template's component during the test, even though the |
@dorontal - aha, you're here too! Thanks. Might get time to take a look this weekend. If you happen to get a response from your post to Ionic let us know |
Definitely, sir! Thanks for saving me a great deal of work, too! |
see 673622d, tests still running without the |
So I was wrong about However, when I add I tried this: (1) added an
(2) added the
And here's the report
The |
No worries. If you still have that repro lying around a PR would be good. Note to self to revert the changes from yesterday. On 3 Jul 2016 01:52, "dorontal" [email protected] wrote:
|
The pull request reproducing the issue is here. It fails Travis of course (nice to see it at work) because this pull request is all about reproducing the test failure. This merge link - Commit d70fe63 - shows the diff. This Travis report link shows test output and has the No value for acessor '' error. |
@dorontal thanks a lot for the PR, looking now |
Interesting that it repros at page level but not component level. Particularly as @page no longer exists and they are both basically ng2 components. |
Just went though what's different with your example in page.ts and my example from earlier in clickerForm.ts. Seems you need to add Ionic's x220:~/code/clicker(dorontal-master)$ git diff
diff --git a/app/pages/page2/page2.ts b/app/pages/page2/page2.ts
index 9e0662b..088c4f8 100644
--- a/app/pages/page2/page2.ts
+++ b/app/pages/page2/page2.ts
@@ -1,9 +1,11 @@
'use strict';
import {Component} from '@angular/core';
+import {TextInput} from 'ionic-angular';
@Component({
templateUrl: 'build/pages/page2/page2.html',
+ directives: [TextInput],
})
export class Page2 {
// NOTE: reproducing clicker issue 108: 'value' should be a string |
For |
I've made those changes to your PR and merged it as a demo Build is passing on travis |
Yes. Thanks so much! I added the |
Thanks for sharing and updating this seed. It was a tremendous help to get me started with testing at all (no prior knowledge). I'm not sure if I'm doing it wrong or if it's a PhantomJS issue - but as soon as I use ngModel in my template, it fails the test with:
The test works when I use ng-model instead, but that breaks angular2/ionic2 function :/ Any ideas how to get that implemented as well?
The text was updated successfully, but these errors were encountered: