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

fix(tests): "no provider" error when running tests #963

Merged
merged 1 commit into from
Sep 14, 2016

Conversation

Igonato
Copy link
Contributor

@Igonato Igonato commented Sep 13, 2016

Fix for #929

Seems like DI derps in the test environment and not able to resolve providers using the new NgModule system. For tests to pass components need to have providers field.

@codecov-io
Copy link

Current coverage is 90.39% (diff: 100%)

Merging #963 into development will not change coverage

@@           development       #963   diff @@
=============================================
  Files               26         26          
  Lines              781        781          
  Methods            142        142          
  Messages             0          0          
  Branches           115        115          
=============================================
  Hits               706        706          
  Misses              75         75          
  Partials             0          0          

Powered by Codecov. Last update 6effd07...b0f1b40

@Martin-Luft
Copy link
Contributor

Martin-Luft commented Sep 14, 2016

@Igonato why is this not needed for datepicker-popup.component (I think this component is dead code), button-checkbox.directive and button-radio.directive? This components and directives also have the ngModel selector binding...? Or are directives not affected?

@otelnov
Copy link
Contributor

otelnov commented Sep 14, 2016

There is "imports" param in TestBed.configureTestingModule where you can pass FormsModule or whatever you need.

@Martin-Luft
Copy link
Contributor

@otelnov this is not working, please see the related issue.

@Igonato
Copy link
Contributor Author

Igonato commented Sep 14, 2016

@Martin-Wegner I don't see any datepicker-popup.component what branch are you on?

As for the others what I did is I imported every ng2-bootstrap module and specified providers field for components that would fail the tests. Test DI doesn't fail for every component nor for every provider, so far it only does so with NgModel and some components. My guess is that some circular dependency needs to happen that can be resolved in the browser but not in testing.

@valorkin
Copy link
Member

@Igonato I have dropped it completely (datepicker-popup.component ) until it is working properly

@Igonato
Copy link
Contributor Author

Igonato commented Sep 14, 2016

@valorkin what was/is wrong with it?

And what do you think about this PR? Did you review the changes, any comments?

@valorkin
Copy link
Member

as temporary solution should work, but will have to find more generic solution later

@Igonato thanks for your time! :)

@valorkin valorkin merged commit 8483615 into valor-software:development Sep 14, 2016
jtomaszewski pushed a commit to jtomaszewski/ng2-bootstrap that referenced this pull request Oct 22, 2016
Gxerxes pushed a commit to Gxerxes/ng2-bootstrap that referenced this pull request Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants