I have a React component that creates a <div> with custom data-attributes eg
<div className="video-wrapper" data-video-source="brightcove" />
Using Enzyme I can assert the classes like so
it('creates a div with correct oVideo attributes', () => {
const videoDiv = component.find('div.video-wrapper')
expect(videoDiv.hasClass('video-wrapper')).to.equal(true);
});
But how can I assert that the data-video-source attribute has the value brightcove?
Aucun commentaire:
Enregistrer un commentaire