From 46a2382d4be4c73b4d49e648d7837f30c7a0da2f Mon Sep 17 00:00:00 2001 From: Kevin Read Date: Sun, 14 Mar 2021 15:10:06 +0100 Subject: [PATCH] Add another test for wrappingComponent --- .../enzyme-test-suite/test/ShallowWrapper-spec.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx b/packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx index 8f8e54a4b..25fdbe333 100644 --- a/packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx +++ b/packages/enzyme-test-suite/test/ShallowWrapper-spec.jsx @@ -679,6 +679,15 @@ describe('shallow', () => { } } + class WrappingComponent extends React.Component { + render() { + const { children } = this.props; + return ( + { children } + ); + } + } + class InnerComponent extends React.Component { render() { return this.context; @@ -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(, { wrappingComponent: WrappingComponent }); + expect(wrapper.text()).to.equal('foo'); + }); }); });