diff --git a/packages/enzyme/src/selectors.js b/packages/enzyme/src/selectors.js index 7036a7ffc..999d7a4bc 100644 --- a/packages/enzyme/src/selectors.js +++ b/packages/enzyme/src/selectors.js @@ -115,7 +115,7 @@ function matchAttributeSelector(node, token) { * [type^="image"] matches type="imageobject" */ case PREFIX_ATTRIBUTE_OPERATOR: - return value === '' ? false : nodePropValue.substr(0, value.length) === value; + return value === '' ? false : nodePropValue.slice(0, value.length) === value; /** * Represents an element with the att attribute whose value ends with the suffix value. * If the value is the empty string then the selector does not represent anything. @@ -123,7 +123,7 @@ function matchAttributeSelector(node, token) { * [type$="image"] matches type="imageobject" */ case SUFFIX_ATTRIBUTE_OPERATOR: - return value === '' ? false : nodePropValue.substr(-value.length) === value; + return value === '' ? false : nodePropValue.slice(-value.length) === value; /** * Represents an element with the att attribute whose value contains at least one * instance of the value. If value is the empty string then the