diff --git a/src/__tests__/ShallowWrapper-spec.js b/src/__tests__/ShallowWrapper-spec.js index 24b365fd9..718df00c0 100644 --- a/src/__tests__/ShallowWrapper-spec.js +++ b/src/__tests__/ShallowWrapper-spec.js @@ -98,6 +98,23 @@ describe('shallow', () => { expect(wrapper.contains('1')).to.equal(false); }); + it('should work with nested strings & numbers', () => { + const wrapper = shallow( +
+
+
{5}
+
+
foo
+
+ ); + + expect(wrapper.contains('foo')).to.equal(true); + expect(wrapper.contains(
foo
)).to.equal(true); + + expect(wrapper.contains(5)).to.equal(true); + expect(wrapper.contains(
{5}
)).to.equal(true); + }); + }); describe('.equals(node)', () => {