Just what it says. Some example code:
let wrapper = shallow();
const b = wrapper
I think @louis-barranqueiro has probably answered your underlying question. That is, you want a CSS selector and so you should have been using className
not class
.
However, to try and answer the question of how to select an element's text using the actual example you gave:
let wrapper = shallow();
you'd need to use something like an object property selector, e.g.:
expect(wrapper.find({ class: "btn btn-primary" }).text()).to.equal('OK');
or prop syntax:
expect(wrapper.find('[class="btn btn-primary"]').text()).to.equal('OK');
(or even more explicitly):
expect(wrapper.find('button[class="btn btn-primary"]').text()).to.equal('OK');