react-i13n
Advanced tools
Comparing version 3.0.0-alpha.7 to 3.0.0-alpha.8
/** | ||
* @jest-environment jsdom | ||
*/ | ||
/** | ||
* Copyright 2020, Yahoo! Inc. | ||
@@ -61,3 +65,3 @@ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. | ||
}); | ||
it('should generate a component with createI13nNode', done => { | ||
it('should generate a component with createI13nNode', () => { | ||
var TestComponent = /*#__PURE__*/forwardRef((props, ref) => { | ||
@@ -70,3 +74,2 @@ var { | ||
}); | ||
done(); | ||
return /*#__PURE__*/React.createElement("div", { | ||
@@ -73,0 +76,0 @@ ref: ref |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
/** | ||
* Copyright 2015 - Present, Yahoo! Inc. | ||
@@ -43,5 +47,3 @@ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. | ||
it('should generate a component with custom displayName', () => { | ||
var TestApp = () => { | ||
return /*#__PURE__*/React.createElement("div", null); | ||
}; // check the initial state is correct after render | ||
var TestApp = () => /*#__PURE__*/React.createElement("div", null); // check the initial state is correct after render | ||
@@ -48,0 +50,0 @@ |
@@ -48,3 +48,3 @@ /** | ||
// 2. input with submit or button type | ||
if (isButtonLike(target)) { | ||
if (isButtonLike(target) && target.type === 'submit') { | ||
return true; | ||
@@ -66,3 +66,3 @@ } | ||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var target = e.target || e.srcElement; | ||
var target = e.currentTarget; | ||
var isForm = isFormSubmit(target); | ||
@@ -92,3 +92,3 @@ var isRedirectLink = isDefaultRedirectLink(target); | ||
if (!isDefaultRedirectLink(target) || isLink(target) && (!href || href && href[0] === '#') || isButtonLike(target) && !target.form) { | ||
if (!isDefaultRedirectLink(target) || isLink(target) && (!href || href && href[0] === '#') || isButtonLike(target) && !isForm) { | ||
isRedirectLink = false; | ||
@@ -95,0 +95,0 @@ isPreventDefault = false; |
/** | ||
* @jest-environment jsdom | ||
*/ | ||
/** | ||
* Copyright 2020, Yahoo! Inc. | ||
@@ -32,3 +36,3 @@ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. | ||
mockClickEvent = { | ||
target: {}, | ||
currentTarget: {}, | ||
button: 0, | ||
@@ -70,3 +74,3 @@ preventDefault: jest.fn() | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -88,4 +92,5 @@ href: 'https://foobar.com' | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'BUTTON', | ||
type: 'submit', | ||
form: { | ||
@@ -113,3 +118,3 @@ submit() { | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'INPUT', | ||
@@ -139,3 +144,3 @@ type: 'submit', | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -160,3 +165,3 @@ href: 'https://foobar.com' | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -186,3 +191,3 @@ href: 'https://foobar.com' | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A' | ||
@@ -206,3 +211,3 @@ }; | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A' | ||
@@ -227,3 +232,3 @@ }; | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'SPAN' | ||
@@ -252,3 +257,3 @@ }; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -280,3 +285,3 @@ href: 'foo' | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -283,0 +288,0 @@ href: 'foo' |
/** | ||
* @jest-environment jsdom | ||
*/ | ||
/** | ||
* Copyright 2020, Yahoo! Inc. | ||
@@ -3,0 +7,0 @@ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. |
@@ -20,2 +20,6 @@ "use strict"; | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
/** | ||
* Copyright 2020, Yahoo! Inc. | ||
@@ -77,3 +81,3 @@ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. | ||
}); | ||
it('should generate a component with createI13nNode', function (done) { | ||
it('should generate a component with createI13nNode', function () { | ||
var TestComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { | ||
@@ -86,3 +90,2 @@ var _useContext = (0, _react.useContext)(_I13nContext["default"]), | ||
}); | ||
done(); | ||
return /*#__PURE__*/_react["default"].createElement("div", { | ||
@@ -89,0 +92,0 @@ ref: ref |
@@ -61,3 +61,3 @@ "use strict"; | ||
// 2. input with submit or button type | ||
if (isButtonLike(target)) { | ||
if (isButtonLike(target) && target.type === 'submit') { | ||
return true; | ||
@@ -82,3 +82,3 @@ } | ||
var target = e.target || e.srcElement; | ||
var target = e.currentTarget; | ||
var isForm = isFormSubmit(target); | ||
@@ -106,3 +106,3 @@ var isRedirectLink = isDefaultRedirectLink(target); | ||
if (!isDefaultRedirectLink(target) || isLink(target) && (!href || href && href[0] === '#') || isButtonLike(target) && !target.form) { | ||
if (!isDefaultRedirectLink(target) || isLink(target) && (!href || href && href[0] === '#') || isButtonLike(target) && !isForm) { | ||
isRedirectLink = false; | ||
@@ -109,0 +109,0 @@ isPreventDefault = false; |
@@ -10,2 +10,6 @@ "use strict"; | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
/** | ||
* Copyright 2020, Yahoo! Inc. | ||
@@ -39,3 +43,3 @@ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. | ||
mockClickEvent = { | ||
target: {}, | ||
currentTarget: {}, | ||
button: 0, | ||
@@ -75,3 +79,3 @@ preventDefault: jest.fn() | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -93,4 +97,5 @@ href: 'https://foobar.com' | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'BUTTON', | ||
type: 'submit', | ||
form: { | ||
@@ -117,3 +122,3 @@ submit: function submit() { | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'INPUT', | ||
@@ -142,3 +147,3 @@ type: 'submit', | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -163,3 +168,3 @@ href: 'https://foobar.com' | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -189,3 +194,3 @@ href: 'https://foobar.com' | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A' | ||
@@ -209,3 +214,3 @@ }; | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A' | ||
@@ -230,3 +235,3 @@ }; | ||
var executedActions = []; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'SPAN' | ||
@@ -255,3 +260,3 @@ }; | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -283,3 +288,3 @@ href: 'foo' | ||
mockClickEvent.target = { | ||
mockClickEvent.currentTarget = { | ||
tagName: 'A', | ||
@@ -286,0 +291,0 @@ href: 'foo' |
@@ -10,2 +10,6 @@ "use strict"; | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
/** | ||
* Copyright 2020, Yahoo! Inc. | ||
@@ -12,0 +16,0 @@ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. |
{ | ||
"name": "react-i13n", | ||
"description": "React I13n provides a performant and scalable solution to application instrumentation.", | ||
"version": "3.0.0-alpha.7", | ||
"version": "3.0.0-alpha.8", | ||
"main": "index.js", | ||
@@ -44,3 +44,3 @@ "module": "index.es.js", | ||
"@babel/register": "^7.9.0", | ||
"@testing-library/react": "^11.0.1", | ||
"@testing-library/react": "^12.0.0", | ||
"babel-eslint": "^10.0.1", | ||
@@ -68,6 +68,6 @@ "babel-loader": "^8.1.0", | ||
"intersection-observer": "^0.12.0", | ||
"jest": "^26.0.1", | ||
"jest": "^27.0.1", | ||
"jest-junit": "^12.0.0", | ||
"minimist": "^1.2.0", | ||
"mocha": "^8.0.1", | ||
"mocha": "^9.0.1", | ||
"object-assign": "^4.0.0", | ||
@@ -74,0 +74,0 @@ "pre-commit": "^1.0.0", |
# react-i13n | ||
[![npm version](https://badge.fury.io/js/react-i13n.svg)](http://badge.fury.io/js/react-i13n) | ||
[![Build Status](https://travis-ci.org/yahoo/react-i13n.svg?branch=master)](https://travis-ci.org/yahoo/react-i13n) | ||
![Build Status](https://github.com/yahoo/react-i13n/actions/workflows/node.js.yml/badge.svg) | ||
[![Coverage Status](https://coveralls.io/repos/yahoo/react-i13n/badge.svg?branch=master&service=github)](https://coveralls.io/github/yahoo/react-i13n?branch=master) | ||
[![Dependency Status](https://david-dm.org/yahoo/react-i13n.svg)](https://david-dm.org/yahoo/react-i13n) | ||
[![devDependency Status](https://david-dm.org/yahoo/react-i13n/dev-status.svg)](https://david-dm.org/yahoo/react-i13n#info=devDependencies) | ||
@@ -9,0 +7,0 @@ `react-i13n` provides a performant, scalable and pluggable approach to instrumenting your React application. |
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
249628
5743
178