Answers for "enzyme find selector"

-1

enzyme find selector

const wrapper = shallow(<MyComponent />);
expect(wrapper.find('.foo')).to.have.lengthOf(1);
expect(wrapper.find('.bar')).to.have.lengthOf(3);

// compound selector
expect(wrapper.find('div.some-class')).to.have.lengthOf(3);

// CSS id selector
expect(wrapper.find('#foo')).to.have.lengthOf(1);
Posted by: Guest on August-11-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language