Skip to content

Commit bbe1c52

Browse files
unverbrauchtpablopalacios
authored andcommitted
Add another test for wrappingComponent
1 parent d2f48f9 commit bbe1c52

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx

+14
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,15 @@ describe('shallow', () => {
679679
}
680680
}
681681

682+
class WrappingComponent extends React.Component {
683+
render() {
684+
const { children } = this.props;
685+
return (
686+
<Provider value="foo">{ children }</Provider>
687+
);
688+
}
689+
}
690+
682691
class InnerComponent extends React.Component {
683692
render() {
684693
return this.context;
@@ -693,6 +702,11 @@ describe('shallow', () => {
693702
const provider = provides.find(InnerComponent).shallow();
694703
expect(provider.text()).to.equal('foo');
695704
});
705+
706+
it('works with wrappingComponent', () => {
707+
const wrapper = shallow(<InnerComponent />, { wrappingComponent: WrappingComponent });
708+
expect(wrapper.text()).to.equal('foo');
709+
});
696710
});
697711
});
698712

0 commit comments

Comments
 (0)