Merge pull request #1598 from syranide/nogettext

Un-mixin ReactBrowserComponentMixin from ReactTextComponent
This commit is contained in:
Paul O’Shannessy 2014-09-26 17:54:32 -07:00
commit 778ca2f862
2 changed files with 15 additions and 8 deletions

View File

@ -47,7 +47,6 @@ var ReactTextComponent = function(props) {
};
mixInto(ReactTextComponent, ReactComponent.Mixin);
mixInto(ReactTextComponent, ReactBrowserComponentMixin);
mixInto(ReactTextComponent, {
/**

View File

@ -58,8 +58,9 @@ var updateChildren = function(d, children) {
};
var expectChildren = function(d, children) {
var textNode;
if (typeof children === 'string') {
var textNode = d.getDOMNode().firstChild;
textNode = d.getDOMNode().firstChild;
if (children === '') {
expect(textNode != null).toBe(false);
@ -75,13 +76,20 @@ var expectChildren = function(d, children) {
var child = children[i];
if (typeof child === 'string') {
var textWrapperNode =
reactComponentExpect(d)
.expectRenderedChildAt(i)
.toBeTextComponent()
.instance();
reactComponentExpect(d)
.expectRenderedChildAt(i)
.toBeTextComponent()
.instance();
expectChildren(textWrapperNode, child);
textNode = d.getDOMNode().childNodes[i].firstChild;
if (child === '') {
expect(textNode != null).toBe(false);
} else {
expect(textNode != null).toBe(true);
expect(textNode.nodeType).toBe(3);
expect(textNode.data).toBe('' + child);
}
} else {
var elementDOMNode =
reactComponentExpect(d)