Fix reactComponentExpect.toBeDOMComponentWithChildCount(0) regression (#8271)

This should fix https://github.com/facebook/react/commit/3e2680411efa3b478afc1f26057f417c7aae7915#commitcomment-19788988.
This commit is contained in:
Dan Abramov
2016-11-11 17:26:19 +00:00
committed by Sebastian Markbåge
parent 4804518c26
commit b9f65d9b1d
+2 -2
View File
@@ -157,8 +157,8 @@ Object.assign(reactComponentExpectInternal.prototype, {
if (count > 0) {
expect(renderedChildren).toBeTruthy();
expect(Object.keys(renderedChildren).length).toBe(count);
} else {
expect(renderedChildren).toBeFalsy();
} else if (renderedChildren) {
expect(Object.keys(renderedChildren).length).toBe(0);
}
}
return this;