zombie icon indicating copy to clipboard operation
zombie copied to clipboard

Event target dataset is undefined in Zombie

Open vnickolov opened this issue 10 years ago • 5 comments

I've been testing a button click and the button had some data- attributes. In the JS code I was using

event.target.dataset 

to obtain these but running this code in Zombie the dataset was undefined. I had to use the getAttribute function instead.

vnickolov avatar Nov 19 '14 14:11 vnickolov

Zombie provides whatever features are available in JSDOM, so you'll want to get this added here: https://github.com/tmpvar/jsdom

assaf avatar Nov 19 '14 17:11 assaf

Thank you for the reply, should I add it there or you'll take care?

vnickolov avatar Nov 20 '14 06:11 vnickolov

It's your issue.

assaf avatar Nov 20 '14 16:11 assaf

jsdom 11.2.0 came out and they now support this, but a lot of their API has changed. I've started a branch to integrate it into zombie, if anyone wants to help me out.

https://github.com/StefanoDeVuono/zombie/tree/801-event-target-dataset

I've updated mocha (which fails the "go forwards" test in history.js--it has both await and done--mocha no longer likes this).

jsdom has changed substantially so I'm going through to integrate it into zombie.js using the tests as guidelines.

Any help would be appreciated!

StefanoDeVuono avatar Aug 23 '17 07:08 StefanoDeVuono

Got it!

https://github.com/StefanoDeVuono/zombie/tree/801-event-target-dataset

edit: well, sort of. sorting out travisci errors for now.

StefanoDeVuono avatar Mar 08 '18 21:03 StefanoDeVuono