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

Recognizer missing in unit test #116

Open
daniellizik opened this issue Jun 20, 2018 · 1 comment
Open

Recognizer missing in unit test #116

daniellizik opened this issue Jun 20, 2018 · 1 comment

Comments

@daniellizik
Copy link

package.json

ember-cli: 2.17.1
ember-cli-babel: 6.8.1
ember-gestures: 1.1.0
embrer-hammertime: 1.5.0

I installed the package with ember install ember-gestures, then added recognizers: 'swipe' to my component as well as a swipeLeft method. The behavior works fine in development, but when I try to unit test the component I get this error:

ember-gestures/recognizers/swipe was not found. You can scaffold this recognizer with 'ember g recognizer swipe'

Same thing happens if I use ember generator to generate a swipe recognizer using the config in this repo:

export default {
  include: [],
  exclude: [],
  options: { threshold: 25, direction: typeof Hammer === 'undefined' ? '' : Hammer.DIRECTION_HORIZONTAL },
  recognizer: 'swipe'
};

Do I need to do any more special component setup in my unit test outside of the setupComponentTest block?

@eriktrom
Copy link
Member

honestly - im not totally sure - you can try [email protected] which depending on your version of ember, might fix it.

tbh though it looks like ember-gestures/recognizers/swipe is being looked up within ember-gestures/addon/recognizers/swipe by default, but it's being re-exported from ember-gestures/app/ember-gestures/recognizers/swipe here https://github.com/html-next/ember-gestures/blob/master/app/ember-gestures/recognizers/swipe.js

which may have never worked in tests... try using 0.6.0 as there was a big change in 1.0 and 1.1.0 - also if u could output your ember version and ember-qunit version, that would help. If you use a component rendering test, for example, if it works in development, it will work there. for the older component tests, unit or integration: true, style, we may need to debug.

if your using ember 3.x, make sure to use ember 3.2 as well, fyi. If not, let me know what version you are using.

thanks for reporting the issue, i help out on this repo, but i don't use this addon (i use pieces of it, manually) but not the whole thing itself, so sorry i don't have a better answer atm.

we can work through it though, just let me know more about your deps :)

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

No branches or pull requests

2 participants