Use #ember-testing-container as a context when testing
See original GitHub issueHi,
when updating to Ember 2.17 our tests start failing due to invalid didEnterViewport
events - component with InViewport
mixin was in window
viewport, but was outside the #ember-testing-container
viewport.
It seems that InViewport
mixin should use #ember-testing-container
when testing as a context instead of window
here
- https://github.com/DockYard/ember-in-viewport/blob/master/addon/mixins/in-viewport.js#L67,
- https://github.com/DockYard/ember-in-viewport/blob/master/addon/mixins/in-viewport.js#L69,
- https://github.com/DockYard/ember-in-viewport/blob/master/addon/mixins/in-viewport.js#L225.
isInViewport
detection should be also changed accordingly
Happy to work on this if this makes sense.
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Testing your Ember application in 2018 - DockYard
Using a few strategies we already talked about, we can now see if an element is outside the scope of the #ember-testing container....
Read more >Introduction - Testing - Ember Guides
Testing is a core part of the Ember framework and its development cycle. Let's assume you are writing an Ember application which will...
Read more >The Ember.js testing guide, I made for myself - Medium
app-context is the value of modulePrefix specified in the application's environment.js . module is used to group similar tests together. A basic unit...
Read more >How to test React Context
The best way to test Context is to make our tests unaware of its ... same way that developers would use them (behavioral...
Read more >Testing - Spring
context package) provides generic, annotation-driven unit and integration testing support that is agnostic of the testing framework in use. The ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Awesome, thank you for confirming @bobisjan, and I’m sorry for that specific bug 😦
We’ll try to get 2.17.2 out soon to hopefully prevent others from hitting it…
Thanks @rwjblue,
with
ember-cli@2.17.1
and changes from ember-cli/ember-cli#7507 our tests pass ✅ withember-in-viewmport@2.1.1
(current) and also with @snewcomer’sinteresection-observer
branch 🎊.So, I think that this issue can be closed ☺️.