.prop(key) => Any
Returns the prop value for the root node of the wrapper with the provided key. It must be a single-node wrapper.
Arguments
-
key
(String
): The prop name, that is,this.props[key]
orprops[key]
for the root node of the wrapper.
Example
const wrapper = mount(<MyComponent foo={10} />); expect(wrapper.prop('foo')).to.equal(10);
Related Methods
© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://enzymejs.github.io/enzyme/docs/api/ReactWrapper/prop.html