diff --git a/src/reactNodeToString.js b/src/reactNodeToString.js
index 8e82dc7..4f6f257 100644
--- a/src/reactNodeToString.js
+++ b/src/reactNodeToString.js
@@ -20,6 +20,8 @@ function reactArrayToJSXString (nodes) {
export default function reactNodeToString (node) {
if (Array.isArray(node)) {
return reactArrayToJSXString(node)
+ } else if (typeof node === 'string') {
+ return node
} else {
return reactElementToJSXString(node)
}
diff --git a/test/contain.test.js b/test/contain.test.js
index 0e4b436..01a7ed2 100644
--- a/test/contain.test.js
+++ b/test/contain.test.js
@@ -22,6 +22,7 @@ class Fixture extends React.Component {
+
Unknown User
)
@@ -35,6 +36,7 @@ describe('#contain', () => {
it('passes when the actual matches the expected', (wrapper) => {
expect(wrapper).to.contain()
expect(wrapper).to.contain()
+ expect(wrapper).to.contain('Unknown User')
}, { render: false })
it('passes negated when the actual does not match the expected', (wrapper) => {
diff --git a/test/containMatchingElement.test.js b/test/containMatchingElement.test.js
index 414aafb..8955919 100644
--- a/test/containMatchingElement.test.js
+++ b/test/containMatchingElement.test.js
@@ -20,6 +20,7 @@ class Fixture extends React.Component {
)
@@ -33,6 +34,7 @@ describe('#containMatchingElement', () => {
it('passes when the actual matches the expected', (wrapper) => {
expect(wrapper).to.containMatchingElement()
expect(wrapper).to.containMatchingElement()
+ expect(wrapper).to.containMatchingElement('Unknown User')
}, { render: false })
it('passes negated when the actual does not match the expected', (wrapper) => {