testing-helpers
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -39,9 +39,9 @@ "use strict"; | ||
findAll = _ref2$findAll === void 0 ? false : _ref2$findAll; | ||
var attribute = _lodash["default"].get(window, "process.env.VUE_APP_TITLE") ? "test-id" : "testID"; | ||
// TODO: currently does not support RN since we're looking for "test-id" vs "testID" | ||
if (findAll) { | ||
return wrapper.findAll("[test-id=\"".concat(testID, "\"]")); | ||
return wrapper.findAll("[".concat(attribute, "=\"").concat(testID, "\"]")); | ||
} | ||
return wrapper.find("[test-id=\"".concat(testID, "\"]")); | ||
return wrapper.find("[".concat(attribute, "=\"").concat(testID, "\"]")); | ||
} | ||
@@ -48,0 +48,0 @@ |
{ | ||
"name": "testing-helpers", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "build/index.js", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/lawnstarter/testing-helpers", |
@@ -16,7 +16,10 @@ import _ from "lodash"; | ||
export function findTestIDInWrapper({ wrapper, testID, findAll = false }) { | ||
// TODO: currently does not support RN since we're looking for "test-id" vs "testID" | ||
const attribute = _.get(window, "process.env.VUE_APP_TITLE") | ||
? "test-id" | ||
: "testID"; | ||
if (findAll) { | ||
return wrapper.findAll(`[test-id="${testID}"]`); | ||
return wrapper.findAll(`[${attribute}="${testID}"]`); | ||
} | ||
return wrapper.find(`[test-id="${testID}"]`); | ||
return wrapper.find(`[${attribute}="${testID}"]`); | ||
} | ||
@@ -23,0 +26,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97568
75