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

Ember 2.10.0 - Calling this.$() in willDestroyElement hooks during unit tests returns undefined #14666

Closed
omarestrella opened this issue Dec 1, 2016 · 3 comments

Comments

@omarestrella
Copy link

After upgrading to Ember 2.10.0, our component unit tests started breaking when willDestroyElement runs because this.$() is now returning undefined. This was not happening in Ember 2.9.0.

You can see this happening in this ember-twiddle.

@pixelhandler
Copy link
Contributor

pixelhandler commented Dec 2, 2016

This looks like a bug, we should be able to use this.$() in willDestroyElement, especially to remove event listeners.

@kamilogorek
Copy link
Contributor

kamilogorek commented Dec 13, 2016

Bug flow:

  1. Renderer calls remove method which contains _transitionTo('destroying') function call link
  2. _transitionTo change currentState to destroying link
  3. _states lookup ends up finding destroying state link
  4. which is created using default state link1 link2
  5. which on the other hand returns undefined for $() calls link

@chancancode
Copy link
Member

@omarestrella @kamilogorek this is fixed in 2.10.2, thanks for reporting!

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