can't test customEvents
See original GitHub issueWe have these on our Application:
customEvents: {
webkitAnimationEnd: 'animationEnd',
msAnimationEnd: 'animationEnd',
oAnimationEnd: 'animationEnd',
animationend: 'animationEnd'
}
…and in a component integration test:
this.render('{{foo-bar}}')
this.$().trigger('click') // works
this.$().trigger('animationEnd') // doesn't work
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Troubleshoot Test Events Tool Issues in Meta Events Manager
Check out these tips to troubleshoot problems you may encounter while using the Test Events tool in Meta Events Manager.
Read more >TypeScript doesn't allow event : CustomEvent in ... - GitHub
In my TypeScript project, I'm trying to write the following code: buttonEl.addEventListener( 'myCustomEvent', ( event : CustomEvent ) => { //do ...
Read more >How to test a method dispatching custom event - Stack Overflow
It's a little clunky looking, but something like this should work if you want to verify an event with the expected type was...
Read more >React, Jest, and CustomEvent testing - libertyseeds.ca
React, Jest, and CustomEvent testing. Simple problem: I need my React component to communicate an event to a JQuery plugin in Rails.
Read more >Dispatching custom events - The Modern JavaScript Tutorial
For automated testing, to “click the button” in the script and see if the interface reacts correctly. Custom events with our own names...
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
Got some help from @rwjblue on this one today and wanted to share here:
It seems that a nicer (but currently undocumented solution) is to
extend
theEventDispatcher
:This works and feels like a better solution since setting up custom events is unlikely to change based on the current environment.
The
_
in the file name is surprising but currently needed. Also there could be a more intentional hook to let users edit the events.Thanks for writing up the solution here. I think I’m going to close this issue now that the solution is documented, but I suspect we might still want to do some work in Ember to make this a bit more ergonomic. I’m happy to help someone spearhead an RFC on this, if they are interested in it…