Skip to content

Commit

Permalink
Add another test for wrappingComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
unverbraucht authored and pablopalacios committed Mar 18, 2022
1 parent d2f48f9 commit bbe1c52
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Expand Up @@ -679,6 +679,15 @@ describe('shallow', () => {
}
}

class WrappingComponent extends React.Component {
render() {
const { children } = this.props;
return (
<Provider value="foo">{ children }</Provider>
);
}
}

class InnerComponent extends React.Component {
render() {
return this.context;
Expand All @@ -693,6 +702,11 @@ describe('shallow', () => {
const provider = provides.find(InnerComponent).shallow();
expect(provider.text()).to.equal('foo');
});

it('works with wrappingComponent', () => {
const wrapper = shallow(<InnerComponent />, { wrappingComponent: WrappingComponent });
expect(wrapper.text()).to.equal('foo');
});
});
});

Expand Down

0 comments on commit bbe1c52

Please sign in to comment.