Comparing version 4.1.2 to 4.2.0
{ | ||
"name": "rquery", | ||
"main": "rquery.js", | ||
"version": "4.1.2", | ||
"version": "4.2.0", | ||
"authors": [ | ||
@@ -6,0 +6,0 @@ "Andrew Hanna <percyhanna@gmail.com>" |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "4.1.2", | ||
"version": "4.2.0", | ||
"repository": { | ||
@@ -16,0 +16,0 @@ "type": "git", |
@@ -236,7 +236,11 @@ (function (rquery) { | ||
if (TestUtils.isCompositeComponent(component)) { | ||
return component._reactInternalInstance | ||
if (component._reactInternalInstance | ||
&& component._reactInternalInstance._currentElement | ||
&& component._reactInternalInstance._currentElement.type | ||
&& (component._reactInternalInstance._currentElement.type.displayName === match[1] | ||
|| component._reactInternalInstance._currentElement.type.name === match[1]); | ||
&& component._reactInternalInstance._currentElement.type) { | ||
var type = component._reactInternalInstance._currentElement.type; | ||
var displayName = (type.displayName || '').replace(/Connect\(([A-Z]\w*)\)/, '$1'); | ||
return (displayName === match[1] || type.name === match[1]); | ||
} | ||
} | ||
@@ -250,4 +254,4 @@ | ||
if (typeof component.type === 'function') { | ||
return (component.type.displayName === match[1] | ||
|| component.type.name === match[1]); | ||
var displayName = (component.type.displayName || '').replace(/Connect\(([A-Z]\w*)\)/, '$1'); | ||
return (displayName === match[1] || component.type.name === match[1]); | ||
} | ||
@@ -254,0 +258,0 @@ |
@@ -115,2 +115,22 @@ function runSelectors (shallow) { | ||
describe('text description of connected component', function () { | ||
before(function () { | ||
this.originalChildComponentDisplayName = ChildComponent.displayName; | ||
ChildComponent.displayName = 'Connect(ChildComponent)'; | ||
this.$r = run('ChildComponent'); | ||
}); | ||
after(function () { | ||
ChildComponent.displayName = this.originalChildComponentDisplayName; | ||
}); | ||
it('finds one component', function () { | ||
expect(this.$r).to.have.length(1); | ||
}); | ||
it('component is instance of ChildComponent', function () { | ||
expectType(this.$r[0], ChildComponent); | ||
}); | ||
}); | ||
describe('text description of DOM component', function () { | ||
@@ -117,0 +137,0 @@ before(function () { |
70606
1728