Just what it says. Some example code:
let wrapper = shallow();
const b = wrapper
Don't forget that you are passing a node (ReactElement) to shallow
function, and there is no HTML attribute class
in React. You have to use className
.
From React documentation
All attributes are camel-cased and the attributes
class
andfor
areclassName
andhtmlFor
, respectively, to match the DOM API specification.
This test should works
const wrapper = shallow();
const button = wrapper.find('.btn');
expect(button.text()).to.be.eql('OK');