rwjblue / ember-native-dom-event-dispatcher

MIT License
25 stars 6 forks source link

Doesn't replace the jQuery dispatcher in unit tests #5

Open cibernox opened 7 years ago

cibernox commented 7 years ago

I found that in component unit tests the event dispatcher is being eagerly initialized (https://github.com/emberjs/ember-test-helpers/blob/356dde46f6e71786b67114c2a5f300f9ed5aa25d/lib/ember-test-helpers/test-module-for-component.js#L103) and at this point it seems to be the default event dispatcher despite of having this addon installed.

I wasn't sure in which repo report this TBQH.

rwjblue commented 7 years ago

Hmm. It should still be our event dispatcher, but maybe you can PR a failing test here so we can test it out?

rwjblue commented 7 years ago

It may be that the unit testing isolated container prevents us from properly resolving event_dispatcher:main, which would mean that we would find the default one that ember registers.

Either way, a failing test would be helpful.

cibernox commented 7 years ago

I haven't tried to reproduce it here, but in the meanwhile I have this example: https://github.com/cibernox/ember-power-calendar/pull/77

Everything pases but the only unit test.

marcoow commented 7 years ago

I'm seeing the exact same error currently in a component unit test. I'll see whether I can come up with a failing test.