@cypress/unique-selector 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +1 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -304,7 +304,7 @@ function unique(el) {
304
304
  // to prefix the selector with `:host >` to anchor against the root. This helps
305
305
  // address the possibility of a unique path segment not existing before reaching
306
306
  // the root.
307
- if (!isUniqueSelector && (0, _isShadowRoot.isShadowRoot)(el.parentNode)) {
307
+ if (!isUniqueSelector && el.parentNode && (0, _isShadowRoot.isShadowRoot)(el.parentNode)) {
308
308
  maybeUniqueSelector = ':host > ' + maybeUniqueSelector;
309
309
  isUniqueSelector = (0, _isUnique.isUnique)(el, maybeUniqueSelector);
310
310
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/unique-selector",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "Given a DOM node, return a unique CSS selector matching only that element",
5
5
  "main": "./lib/index.js",
6
6
  "jsnext:main": "./src/index.js",