@testing-library/jest-native
Advanced tools
Comparing version 4.0.9 to 4.0.10
@@ -1,3 +0,1 @@ | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,16 +7,6 @@ value: true | ||
var _compose = _interopRequireDefault(require("ramda/src/compose.js")); | ||
var _jestMatcherUtils = require("jest-matcher-utils"); | ||
var _defaultTo = _interopRequireDefault(require("ramda/src/defaultTo.js")); | ||
var _ramda = require("ramda"); | ||
var _includes = _interopRequireDefault(require("ramda/src/includes.js")); | ||
var _path = _interopRequireDefault(require("ramda/src/path.js")); | ||
var _propEq = _interopRequireDefault(require("ramda/src/propEq.js")); | ||
var _anyPass = _interopRequireDefault(require("ramda/src/anyPass.js")); | ||
var _jestMatcherUtils = require("jest-matcher-utils"); | ||
var _utils = require("./utils"); | ||
@@ -33,6 +21,6 @@ | ||
function isElementDisabled(element) { | ||
var propDisabled = (0, _path.default)(['props', 'disabled'], element); | ||
var hasStatesDisabled = (0, _compose.default)((0, _includes.default)('disabled'), (0, _defaultTo.default)([]), (0, _path.default)(['props', 'accessibilityStates'])); | ||
var hasStateDisabled = (0, _compose.default)((0, _propEq.default)('disabled', true), (0, _defaultTo.default)({}), (0, _path.default)(['props', 'accessibilityState'])); | ||
var stateDisabled = (0, _anyPass.default)([hasStatesDisabled, hasStateDisabled])(element); | ||
var propDisabled = (0, _ramda.path)(['props', 'disabled'], element); | ||
var hasStatesDisabled = (0, _ramda.compose)((0, _ramda.includes)('disabled'), (0, _ramda.defaultTo)([]), (0, _ramda.path)(['props', 'accessibilityStates'])); | ||
var hasStateDisabled = (0, _ramda.compose)((0, _ramda.propEq)('disabled', true), (0, _ramda.defaultTo)({}), (0, _ramda.path)(['props', 'accessibilityState'])); | ||
var stateDisabled = (0, _ramda.anyPass)([hasStatesDisabled, hasStateDisabled])(element); | ||
return DISABLE_TYPES.includes((0, _utils.getType)(element)) && (Boolean(propDisabled) || stateDisabled); | ||
@@ -39,0 +27,0 @@ } |
@@ -1,3 +0,1 @@ | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -10,10 +8,4 @@ value: true | ||
var _compose = _interopRequireDefault(require("ramda/src/compose.js")); | ||
var _ramda = require("ramda"); | ||
var _defaultTo = _interopRequireDefault(require("ramda/src/defaultTo.js")); | ||
var _path = _interopRequireDefault(require("ramda/src/path.js")); | ||
var _isEmpty = _interopRequireDefault(require("ramda/src/isEmpty.js")); | ||
var _utils = require("./utils"); | ||
@@ -26,3 +18,3 @@ | ||
return { | ||
pass: (0, _compose.default)(_isEmpty.default, (0, _defaultTo.default)({}), (0, _path.default)(['props', 'children']))(element), | ||
pass: (0, _ramda.compose)(_ramda.isEmpty, (0, _ramda.defaultTo)({}), (0, _ramda.path)(['props', 'children']))(element), | ||
message: function message() { | ||
@@ -29,0 +21,0 @@ return [(0, _jestMatcherUtils.matcherHint)((_this.isNot ? '.not' : '') + ".toBeEmpty", 'element', ''), '', 'Received:', (0, _utils.printElement)(element)].join('\n'); |
@@ -1,3 +0,1 @@ | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,6 +6,6 @@ value: true | ||
var _equals = _interopRequireDefault(require("ramda/src/equals.js")); | ||
var _jestMatcherUtils = require("jest-matcher-utils"); | ||
var _ramda = require("ramda"); | ||
var _utils = require("./utils"); | ||
@@ -28,4 +26,4 @@ | ||
matches = container.findAll(function (node) { | ||
var sameType = (0, _equals.default)(node.type, element.type); | ||
var sameProps = (0, _equals.default)(node.props, element.props); | ||
var sameType = (0, _ramda.equals)(node.type, element.type); | ||
var sameProps = (0, _ramda.equals)(node.props, element.props); | ||
return sameType && sameProps; | ||
@@ -32,0 +30,0 @@ }); |
@@ -1,3 +0,1 @@ | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -8,6 +6,6 @@ value: true | ||
var _equals = _interopRequireDefault(require("ramda/src/equals.js")); | ||
var _jestMatcherUtils = require("jest-matcher-utils"); | ||
var _ramda = require("ramda"); | ||
var _utils = require("./utils"); | ||
@@ -31,3 +29,3 @@ | ||
return { | ||
pass: isDefined ? hasProp && (0, _equals.default)(prop, expectedValue) : hasProp, | ||
pass: isDefined ? hasProp && (0, _ramda.equals)(prop, expectedValue) : hasProp, | ||
message: function message() { | ||
@@ -34,0 +32,0 @@ var to = _this.isNot ? 'not to' : 'to'; |
@@ -18,16 +18,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _compose = _interopRequireDefault(require("ramda/src/compose.js")); | ||
var _ramda = require("ramda"); | ||
var _all = _interopRequireDefault(require("ramda/src/all.js")); | ||
var _flatten = _interopRequireDefault(require("ramda/src/flatten.js")); | ||
var _mergeAll = _interopRequireDefault(require("ramda/src/mergeAll.js")); | ||
var _toPairs = _interopRequireDefault(require("ramda/src/toPairs.js")); | ||
var _utils = require("./utils"); | ||
function isSubset(expected, received) { | ||
return (0, _compose.default)((0, _all.default)(function (_ref) { | ||
return (0, _ramda.compose)((0, _ramda.all)(function (_ref) { | ||
var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | ||
@@ -37,8 +29,8 @@ prop = _ref2[0], | ||
return Array.isArray(value) ? isSubset((0, _mergeAll.default)(value), (0, _mergeAll.default)(received[prop])) : received[prop] === value; | ||
}), _toPairs.default)(expected); | ||
return Array.isArray(value) ? isSubset((0, _ramda.mergeAll)(value), (0, _ramda.mergeAll)(received[prop])) : received[prop] === value; | ||
}), _ramda.toPairs)(expected); | ||
} | ||
function mergeAllStyles(styles) { | ||
return (0, _compose.default)(_mergeAll.default, _flatten.default)(styles); | ||
return (0, _ramda.compose)(_ramda.mergeAll, _ramda.flatten)(styles); | ||
} | ||
@@ -45,0 +37,0 @@ |
{ | ||
"name": "@testing-library/jest-native", | ||
"version": "4.0.9", | ||
"version": "4.0.10", | ||
"description": "Custom jest matchers to test the state of React Native", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
35728
368