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
Integration tests fail with ember-wormhole #25
Comments
Also seeing this - any advice on the easiest way to Shim? |
We're open to anything we can do to improve developer ergonomics here. |
is this something that is affecting the out come of tests? I just saw the error, but I'm only just starting to write tests for my app. |
I got around this by doing the following: Bring ENV into the component:
(Your directory structure may be different here) In the init() method of the component call
And then in the component template
|
I ran into this error as well. My solution was to just add the element from my test and then remove it when the test is over. test('an access module without subAccessModules cannot be selected', function(assert) {
$('body').append('<div id="modal"></div>');
// test
$('#modal').remove();
}); |
@skaterdav85 I like your solution b/c it does not involve modify production code to detect a testing environment. @adam-knights your solution may have problems with acceptance tests. We were doing test env detection in production code to change behavior during tests and it causes acceptance tests to fail.... |
Maybe my case was simpler, I just added the element to <!-- ... -->
<script src="assets/test-loader.js"></script>
{{content-for 'body-footer'}}
{{content-for 'test-body-footer'}}
<div id="ember-wormhole"></div>
</body>
</html> |
@lukemelia, thanks for pointing to this issue. Would you happen to be able to explain the last comment here? Is there more to the story to get that code snippet working? Thanks |
@brancusi the crux of the issue is that if you relocate a node outside of the I don't think there is a one-size fits all answer to this problem. But if you understand what's going on, you can likely come up with a suitable way to address it in your test suite. |
Thanks @lukemelia. @vladimir-e, would you be able to share the test case? I'm still unsure on how to rig this to work. Thank you |
@lukemelia maybe ember-wormhole could warn the user when the wormhole isn't inside the |
Good idea, @knownasilya. I'd definitely be interested in a PR along these lines. |
fwiw, |
Hi, If i use <button {{action 'search' "ab"}}> then i get error "had no action handler for search" but integration tests run fine but if i use {{action search "ab"}} then i don't get error "had no action handler for search" and works fine but again in integration tests i get error "You specified a quoteless path to the {{action}} helper which did not resolve to an action name (a string). Perhaps you meant to use a quoted actionName? " |
The default generated component integration tests from ember-cli fail if you use ember-wormhole in that component, since the destination element would be elsewhere in your application.
ember-wormhole/addon/components/ember-wormhole.js
Line 91 in 0f48d27
This can be fixed by shimming the destination into those tests, but I'm wondering if changing to a warning or assert instead of throwing an error may be a better experience?
The text was updated successfully, but these errors were encountered: