Skip to content

Commit d166048

Browse files
authored
Merge branch 'master' into issue1916
2 parents 9d4b3b7 + 7ff8ea2 commit d166048

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -416,26 +416,6 @@ describeWithDOM('mount', () => {
416416
expect(wrapper.context().name).to.equal(context.name);
417417
expect(wrapper.context('name')).to.equal(context.name);
418418
});
419-
420-
itIf(is('< 16'), 'works with SFCs', () => {
421-
const Foo = ({ foo }) => (
422-
<div>
423-
<div className="bar">bar</div>
424-
<div className="qoo">{foo}</div>
425-
</div>
426-
);
427-
428-
Foo.contextTypes = {
429-
_: PropTypes.string,
430-
};
431-
432-
const wrapper = mount(<Foo foo="qux" />, {
433-
context: {
434-
_: 'foo',
435-
},
436-
});
437-
expect(wrapper.context('_')).to.equal('foo');
438-
});
439419
});
440420
});
441421

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ describe('shallow', () => {
284284
);
285285
SimpleComponent.contextTypes = { name: PropTypes.string };
286286

287+
const context = { name: 'foo' };
287288
const wrapper = shallow(<SimpleComponent />, { context });
288289

289290
expect(wrapper.context().name).to.equal(context.name);
@@ -790,11 +791,11 @@ describe('shallow', () => {
790791

791792
expect(() => wrapper.contains({})).to.throw(
792793
Error,
793-
'ShallowWrapper::contains() can only be called with ReactElement (or array of them), string or number as argument.', // eslint-disable-line max-len
794+
'ShallowWrapper::contains() can only be called with a ReactElement (or an array of them), a string, or a number as an argument.',
794795
);
795796
expect(() => wrapper.contains(() => ({}))).to.throw(
796797
Error,
797-
'ShallowWrapper::contains() can only be called with ReactElement (or array of them), string or number as argument.', // eslint-disable-line max-len
798+
'ShallowWrapper::contains() can only be called with a ReactElement (or an array of them), a string, or a number as an argument.',
798799
);
799800
});
800801

packages/enzyme/src/ShallowWrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ class ShallowWrapper {
757757
contains(nodeOrNodes) {
758758
const adapter = getAdapter(this[OPTIONS]);
759759
if (!isReactElementAlike(nodeOrNodes, adapter)) {
760-
throw new Error('ShallowWrapper::contains() can only be called with ReactElement (or array of them), string or number as argument.');
760+
throw new Error('ShallowWrapper::contains() can only be called with a ReactElement (or an array of them), a string, or a number as an argument.');
761761
}
762762
const predicate = Array.isArray(nodeOrNodes)
763763
? other => containsChildrenSubArray(

0 commit comments

Comments
 (0)