Skip to content

Commit

Permalink
Merge pull request #179 from kirovboris/fix_get_container
Browse files Browse the repository at this point in the history
Fixed getContainer - left only findReact cases
  • Loading branch information
kirovboris authored Dec 15, 2020
2 parents f96fc2d + bf21083 commit 98ba90e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testcafe-react-selectors",
"version": "4.1.2",
"version": "4.1.3",
"description": "ReactJS selectors for TestCafe",
"repository": "https://github.com/DevExpress/testcafe-react-selectors",
"main": "lib/index",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const ReactSelector = Selector(selector => {
window['$testCafeReactSelector'] = selectorReact16or17;
window['$testCafeReact16or17Roots'] = rootEls;
foundDOMNodes = selectorReact16or17(selector);
foundDOMNodes = selectorReact16or17(selector, false);
}

visitedRootEls = [];
Expand Down Expand Up @@ -214,7 +214,7 @@ export const ReactSelector = Selector(selector => {
const reactSelector = window['$testCafeReactSelector'];
return reactSelector(selector, componentInstances);
return reactSelector(selector, true, componentInstances);
}
}, { returnDOMNodes: true });

Expand Down
2 changes: 1 addition & 1 deletion src/react-15/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*global window rootEls defineSelectorProperty visitedRootEls checkRootNodeVisited*/

/*eslint-disable no-unused-vars*/
function react15elector (selector, parents = rootEls) {
function react15elector (selector, _, parents = rootEls) {
const ELEMENT_NODE = 1;
const COMMENT_NODE = 8;

Expand Down
4 changes: 2 additions & 2 deletions src/react-16-17/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*global window document Node rootEls defineSelectorProperty visitedRootEls checkRootNodeVisited*/

/*eslint-disable no-unused-vars*/
function react16or17Selector (selector, parents = rootEls) {
function react16or17Selector (selector, renderedRootIsUnknown, parents = rootEls) {
window['%testCafeReactFoundComponents%'] = [];

const { getRenderedComponentVersion } = window['%testCafeReactSelectorUtils%']['16|17'];
Expand Down Expand Up @@ -42,7 +42,7 @@ function react16or17Selector (selector, parents = rootEls) {
}

function getContainer (component) {
let node = getRenderedComponentVersion(component, rootEls);
let node = renderedRootIsUnknown ? getRenderedComponentVersion(component, rootEls) : component;

while (!(node.stateNode instanceof Node)) {
if (node.child) node = node.child;
Expand Down

0 comments on commit 98ba90e

Please sign in to comment.