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 committed Mar 14, 2021
1 parent 6707c28 commit 46a2382
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx
Original file line number Diff line number Diff line change
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 46a2382

Please sign in to comment.