From 657d6e3dc047f9bdb111da69801bffe6941c9328 Mon Sep 17 00:00:00 2001 From: krissalvador27 Date: Wed, 5 Dec 2018 00:42:55 -0500 Subject: [PATCH 1/2] Upgrade react + peer dependencies + enzyme --- package-lock.json | 474 +++++++++++++++++++++++++------------------ package.json | 15 +- tests/jsdom/setup.js | 10 +- 3 files changed, 289 insertions(+), 210 deletions(-) diff --git a/package-lock.json b/package-lock.json index f509c392..848d5aa3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -215,6 +215,12 @@ "samsam": "1.3.0" } }, + "@types/node": { + "version": "10.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.12.tgz", + "integrity": "sha512-Pr+6JRiKkfsFvmU/LK68oBRCQeEg36TyAbPhc2xpez24OOZZCuoIhWGTd39VZy6nGafSbxzGouFPTFD/rR1A0A==", + "dev": true + }, "@webassemblyjs/ast": { "version": "1.7.11", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.7.11.tgz", @@ -626,6 +632,17 @@ "dev": true, "optional": true }, + "array.prototype.flat": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz", + "integrity": "sha512-rVqIs330nLJvfC7JqYvEWwqVr5QjYF1ib02i3YJtR/fICO6527Tjpc/e4Mvmxh3GIePPreRXMdaGyC99YphWEw==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.10.0", + "function-bind": "^1.1.1" + } + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -1997,13 +2014,12 @@ } }, "chai-enzyme": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/chai-enzyme/-/chai-enzyme-0.8.0.tgz", - "integrity": "sha1-YJxVKh3NsJH0NeHigcxPIUmjO+E=", + "version": "1.0.0-beta.0", + "resolved": "https://registry.npmjs.org/chai-enzyme/-/chai-enzyme-1.0.0-beta.0.tgz", + "integrity": "sha512-b2XJjyW1PfnW5a5ZBBcZWZJUhq8CA1kpTyXLf4Nac+EaiTuIyYeYN0Ft0qYoW+clinusKDhvJygiVktjhvvFvg==", "dev": true, "requires": { - "html": "^1.0.0", - "react-element-to-jsx-string": "^5.0.0" + "html": "^1.0.0" } }, "chalk": { @@ -2056,27 +2072,28 @@ "dev": true }, "cheerio": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", - "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", + "version": "1.0.0-rc.2", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.2.tgz", + "integrity": "sha1-S59TqBsn5NXawxwP/Qz6A8xoMNs=", "dev": true, "requires": { "css-select": "~1.2.0", "dom-serializer": "~0.1.0", "entities": "~1.1.1", "htmlparser2": "^3.9.1", - "lodash.assignin": "^4.0.9", - "lodash.bind": "^4.1.4", - "lodash.defaults": "^4.0.1", - "lodash.filter": "^4.4.0", - "lodash.flatten": "^4.2.0", - "lodash.foreach": "^4.3.0", - "lodash.map": "^4.4.0", - "lodash.merge": "^4.4.0", - "lodash.pick": "^4.2.1", - "lodash.reduce": "^4.4.0", - "lodash.reject": "^4.4.0", - "lodash.some": "^4.4.0" + "lodash": "^4.15.0", + "parse5": "^3.0.1" + }, + "dependencies": { + "parse5": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", + "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", + "dev": true, + "requires": { + "@types/node": "*" + } + } } }, "chokidar": { @@ -2605,17 +2622,6 @@ "sha.js": "^2.4.8" } }, - "create-react-class": { - "version": "15.6.3", - "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.3.tgz", - "integrity": "sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==", - "dev": true, - "requires": { - "fbjs": "^0.8.9", - "loose-envify": "^1.3.1", - "object-assign": "^4.1.1" - } - }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", @@ -3235,7 +3241,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, "requires": { "object-keys": "^1.0.12" } @@ -3426,6 +3431,12 @@ } } }, + "discontinuous-range": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", + "integrity": "sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=", + "dev": true + }, "dns-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", @@ -3541,12 +3552,6 @@ "safer-buffer": "^2.1.0" } }, - "editions": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/editions/-/editions-1.3.4.tgz", - "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", - "dev": true - }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -3622,21 +3627,62 @@ "dev": true }, "enzyme": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/enzyme/-/enzyme-2.9.1.tgz", - "integrity": "sha1-B9XOaRJBJA+4F78sSxjW5TAkDfY=", - "dev": true, - "requires": { - "cheerio": "^0.22.0", - "function.prototype.name": "^1.0.0", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/enzyme/-/enzyme-3.7.0.tgz", + "integrity": "sha512-QLWx+krGK6iDNyR1KlH5YPZqxZCQaVF6ike1eDJAOg0HvSkSCVImPsdWaNw6v+VrnK92Kg8jIOYhuOSS9sBpyg==", + "dev": true, + "requires": { + "array.prototype.flat": "^1.2.1", + "cheerio": "^1.0.0-rc.2", + "function.prototype.name": "^1.1.0", + "has": "^1.0.3", + "is-boolean-object": "^1.0.0", + "is-callable": "^1.1.4", + "is-number-object": "^1.0.3", + "is-string": "^1.0.4", "is-subset": "^0.1.1", - "lodash": "^4.17.4", + "lodash.escape": "^4.0.1", + "lodash.isequal": "^4.5.0", + "object-inspect": "^1.6.0", "object-is": "^1.0.1", - "object.assign": "^4.0.4", + "object.assign": "^4.1.0", "object.entries": "^1.0.4", "object.values": "^1.0.4", - "prop-types": "^15.5.10", - "uuid": "^3.0.1" + "raf": "^3.4.0", + "rst-selector-parser": "^2.2.3", + "string.prototype.trim": "^1.1.2" + } + }, + "enzyme-adapter-react-16": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.7.0.tgz", + "integrity": "sha512-rDr0xlnnFPffAPYrvG97QYJaRl9unVDslKee33wTStsBEwZTkESX1H7VHGT5eUc6ifNzPgOJGvSh2zpHT4gXjA==", + "requires": { + "enzyme-adapter-utils": "^1.9.0", + "function.prototype.name": "^1.1.0", + "object.assign": "^4.1.0", + "object.values": "^1.0.4", + "prop-types": "^15.6.2", + "react-is": "^16.6.1", + "react-test-renderer": "^16.0.0-0" + } + }, + "enzyme-adapter-utils": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/enzyme-adapter-utils/-/enzyme-adapter-utils-1.9.0.tgz", + "integrity": "sha512-uMe4xw4l/Iloh2Fz+EO23XUYMEQXj5k/5ioLUXCNOUCI8Dml5XQMO9+QwUq962hBsY5qftfHHns+d990byWHvg==", + "requires": { + "function.prototype.name": "^1.1.0", + "object.assign": "^4.1.0", + "prop-types": "^15.6.2", + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + } } }, "errno": { @@ -3652,7 +3698,6 @@ "version": "1.12.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", - "dev": true, "requires": { "es-to-primitive": "^1.1.1", "function-bind": "^1.1.1", @@ -3665,7 +3710,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", - "dev": true, "requires": { "is-callable": "^1.1.1", "is-date-object": "^1.0.1", @@ -4984,14 +5028,12 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "function.prototype.name": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.0.tgz", "integrity": "sha512-Bs0VRrTz4ghD8pTmbJQD1mZ8A/mN0ur/jGz+A6FBxPDUPkm1tNfF6bhTYPA7i7aF4lZJVr+OXTNNrnnIl58Wfg==", - "dev": true, "requires": { "define-properties": "^1.1.2", "function-bind": "^1.1.1", @@ -5163,7 +5205,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -5186,8 +5227,7 @@ "has-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" }, "has-value": { "version": "1.0.0", @@ -5446,9 +5486,9 @@ } }, "htmlparser2": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", - "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz", + "integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==", "dev": true, "requires": { "domelementtype": "^1.3.0", @@ -5456,7 +5496,20 @@ "domutils": "^1.5.1", "entities": "^1.1.1", "inherits": "^2.0.1", - "readable-stream": "^2.0.2" + "readable-stream": "^3.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.0.6.tgz", + "integrity": "sha512-9E1oLoOWfhSXHGv6QlwXJim7uNzd9EVlWK+21tCU9Ju/kR0/p2AZYPz4qSchgO8PlLIH4FpZYfzwS+rEksZjIg==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "http-deceiver": { @@ -6204,6 +6257,12 @@ "binary-extensions": "^1.0.0" } }, + "is-boolean-object": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.0.0.tgz", + "integrity": "sha1-mPiygDBoQhmpXzdc+9iM40Bd/5M=", + "dev": true + }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -6213,8 +6272,7 @@ "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" }, "is-data-descriptor": { "version": "0.1.4", @@ -6228,8 +6286,7 @@ "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" }, "is-decimal": { "version": "1.0.2", @@ -6325,6 +6382,12 @@ "kind-of": "^3.0.2" } }, + "is-number-object": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.3.tgz", + "integrity": "sha1-8mWrian0RQNO9q/xWo8AsA9VF5k=", + "dev": true + }, "is-path-cwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", @@ -6396,17 +6459,10 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, "requires": { "has": "^1.0.1" } }, - "is-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", - "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", - "dev": true - }, "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", @@ -6419,6 +6475,12 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-string": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.4.tgz", + "integrity": "sha1-zDqbaYV9Yh6WNyWiTK7shzuCbmQ=", + "dev": true + }, "is-subset": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", @@ -6437,8 +6499,7 @@ "is-symbol": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", - "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", - "dev": true + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=" }, "is-typedarray": { "version": "1.0.0", @@ -6804,46 +6865,22 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" }, - "lodash.assignin": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", - "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=", - "dev": true - }, - "lodash.bind": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", - "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=", - "dev": true - }, "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", "dev": true }, - "lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=", - "dev": true - }, - "lodash.filter": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz", - "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=", + "lodash.escape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz", + "integrity": "sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg=", "dev": true }, - "lodash.flatten": { + "lodash.flattendeep": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, - "lodash.foreach": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", - "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, "lodash.get": { @@ -6852,10 +6889,10 @@ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, - "lodash.map": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", - "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=", + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", "dev": true }, "lodash.memoize": { @@ -6864,36 +6901,6 @@ "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==", - "dev": true - }, - "lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=", - "dev": true - }, - "lodash.reduce": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", - "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=", - "dev": true - }, - "lodash.reject": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz", - "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=", - "dev": true - }, - "lodash.some": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", - "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=", - "dev": true - }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -7285,6 +7292,12 @@ "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" }, + "moo": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/moo/-/moo-0.4.3.tgz", + "integrity": "sha512-gFD2xGCl8YFgGHsqJ9NKRVdwlioeW3mI1iqfLNYQOv0+6JRwG58Zk9DIGQgyIaffSYaO1xsKnMaYzzNr1KyIAw==", + "dev": true + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -7379,6 +7392,19 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "nearley": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.15.1.tgz", + "integrity": "sha512-8IUY/rUrKz2mIynUGh8k+tul1awMKEjeHHC5G3FHvvyAW6oq4mQfNp2c0BMea+sYZJvYcrrM6GmZVIle/GRXGw==", + "dev": true, + "requires": { + "moo": "^0.4.3", + "nomnom": "~1.6.2", + "railroad-diagrams": "^1.0.0", + "randexp": "0.4.6", + "semver": "^5.4.1" + } + }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", @@ -7475,6 +7501,24 @@ "vm-browserify": "0.0.4" } }, + "nomnom": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.6.2.tgz", + "integrity": "sha1-hKZqJgF0QI/Ft3oY+IjszET7aXE=", + "dev": true, + "requires": { + "colors": "0.5.x", + "underscore": "~1.4.4" + }, + "dependencies": { + "colors": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/colors/-/colors-0.5.1.tgz", + "integrity": "sha1-fQAj6usVTo7p/Oddy5I9DtFmd3Q=", + "dev": true + } + } + }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", @@ -7576,6 +7620,12 @@ } } }, + "object-inspect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", + "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "dev": true + }, "object-is": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.1.tgz", @@ -7585,8 +7635,7 @@ "object-keys": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", - "dev": true + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" }, "object-visit": { "version": "1.0.1", @@ -7609,7 +7658,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, "requires": { "define-properties": "^1.1.2", "function-bind": "^1.1.1", @@ -7671,7 +7719,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.0.4.tgz", "integrity": "sha1-5STaCbT2b/Bd9FdUbscqyZ8TBpo=", - "dev": true, "requires": { "define-properties": "^1.1.2", "es-abstract": "^1.6.1", @@ -8803,6 +8850,31 @@ "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==", "dev": true }, + "raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "dev": true, + "requires": { + "performance-now": "^2.1.0" + } + }, + "railroad-diagrams": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", + "integrity": "sha1-635iZ1SN3t+4mcG5Dlc3RVnN234=", + "dev": true + }, + "randexp": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz", + "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", + "dev": true, + "requires": { + "discontinuous-range": "1.0.0", + "ret": "~0.1.10" + } + }, "randomatic": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", @@ -8875,16 +8947,15 @@ "dev": true }, "react": { - "version": "15.6.2", - "resolved": "https://registry.npmjs.org/react/-/react-15.6.2.tgz", - "integrity": "sha1-26BDSrQ5z+gvEI8PURZjkIF5qnI=", + "version": "16.6.3", + "resolved": "https://registry.npmjs.org/react/-/react-16.6.3.tgz", + "integrity": "sha512-zCvmH2vbEolgKxtqXL2wmGCUxUyNheYn/C+PD1YAjfxHC54+MhdruyhO7QieQrYsYeTxrn93PM2y0jRH1zEExw==", "dev": true, "requires": { - "create-react-class": "^15.6.0", - "fbjs": "^0.8.9", "loose-envify": "^1.1.0", - "object-assign": "^4.1.0", - "prop-types": "^15.5.10" + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "scheduler": "^0.11.2" } }, "react-addons-update": { @@ -8927,30 +8998,21 @@ } }, "react-dom": { - "version": "15.6.2", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-15.6.2.tgz", - "integrity": "sha1-Qc+t9pO3V/rycIRDodH9WgK+9zA=", + "version": "16.6.3", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.6.3.tgz", + "integrity": "sha512-8ugJWRCWLGXy+7PmNh8WJz3g1TaTUt1XyoIcFN+x0Zbkoz+KKdUyx1AQLYJdbFXjuF41Nmjn5+j//rxvhFjgSQ==", "dev": true, "requires": { - "fbjs": "^0.8.9", "loose-envify": "^1.1.0", - "object-assign": "^4.1.0", - "prop-types": "^15.5.10" + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "scheduler": "^0.11.2" } }, - "react-element-to-jsx-string": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/react-element-to-jsx-string/-/react-element-to-jsx-string-5.0.7.tgz", - "integrity": "sha1-xmOkgAqccSEVwNhRnLAhWkah8PI=", - "dev": true, - "requires": { - "collapse-white-space": "^1.0.0", - "is-plain-object": "^2.0.1", - "lodash": "^4.17.4", - "sortobject": "^1.0.0", - "stringify-object": "2.4.0", - "traverse": "^0.6.6" - } + "react-is": { + "version": "16.6.3", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.6.3.tgz", + "integrity": "sha512-u7FDWtthB4rWibG/+mFbVd5FvdI20yde86qKGx4lVUTWmPlSWQ4QxbBIrrs+HnXGbxOUlUzTAP/VDmvCwaP2yA==" }, "react-pure-render-debug": { "version": "1.1.1", @@ -8991,13 +9053,14 @@ } }, "react-test-renderer": { - "version": "15.6.2", - "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-15.6.2.tgz", - "integrity": "sha1-0DM0NPwsQ4CSaWyncNpe1IA376g=", - "dev": true, + "version": "16.6.3", + "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.6.3.tgz", + "integrity": "sha512-B5bCer+qymrQz/wN03lT0LppbZUDRq6AMfzMKrovzkGzfO81a9T+PWQW6MzkWknbwODQH/qpJno/yFQLX5IWrQ==", "requires": { - "fbjs": "^0.8.9", - "object-assign": "^4.1.0" + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "react-is": "^16.6.3", + "scheduler": "^0.11.2" } }, "readable-stream": { @@ -9503,6 +9566,16 @@ "inherits": "^2.0.1" } }, + "rst-selector-parser": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz", + "integrity": "sha1-gbIw6i/MYGbInjRy3nlChdmwPZE=", + "dev": true, + "requires": { + "lodash.flattendeep": "^4.4.0", + "nearley": "^2.7.10" + } + }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", @@ -9573,6 +9646,15 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, + "scheduler": { + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.11.3.tgz", + "integrity": "sha512-i9X9VRRVZDd3xZw10NY5Z2cVMbdYg6gqFecfj79USv1CFN+YrJ3gIPRKf1qlY+Sxly4djoKdfx1T+m9dnRB8kQ==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, "schema-utils": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", @@ -9996,15 +10078,6 @@ "is-plain-obj": "^1.0.0" } }, - "sortobject": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/sortobject/-/sortobject-1.1.1.tgz", - "integrity": "sha1-T2ldTUTtCkwGSCw0wlgqLc3CqzQ=", - "dev": true, - "requires": { - "editions": "^1.1.1" - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -10223,6 +10296,17 @@ } } }, + "string.prototype.trim": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", + "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.0", + "function-bind": "^1.0.2" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -10244,16 +10328,6 @@ "is-hexadecimal": "^1.0.0" } }, - "stringify-object": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-2.4.0.tgz", - "integrity": "sha1-xi0RAj6yH+LZsIe+A5om3zsioJ0=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0", - "is-regexp": "^1.0.0" - } - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -10760,12 +10834,6 @@ "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", "dev": true }, - "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", - "dev": true - }, "trim": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", @@ -10861,6 +10929,12 @@ "integrity": "sha512-LtzwHlVHwFGTptfNSgezHp7WUlwiqb0gA9AALRbKaERfxwJoiX0A73QbTToxteIAuIaFshhgIZfqK8s7clqgnA==", "dev": true }, + "underscore": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", + "integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=", + "dev": true + }, "unherit": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.1.tgz", diff --git a/package.json b/package.json index f6dcf283..281d9bee 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "dependencies": { "d3": "^4.4.0", "d3-sankey": "^0.7.1", + "enzyme-adapter-react-16": "^1.7.0", "invariant": "^2.2.0", "lodash": "^4.5.1", "moment": "^2.10.6", @@ -48,8 +49,8 @@ "units-css": "^0.4.0" }, "peerDependencies": { - "react": ">=0.14.0, <16.0.0", - "react-dom": ">=0.14.0, <16.0.0" + "react": "^15.6.0 || ^16.0.0", + "react-dom": "^15.6.0 || ^16.0.0" }, "devDependencies": { "babel-cli": "^6.6.0", @@ -62,12 +63,12 @@ "babel-preset-react": "^6.5.0", "babel-register": "^6.7.2", "chai": "^4.1.1", - "chai-enzyme": "^0.8.0", + "chai-enzyme": "^1.0.0-beta.0", "clean-webpack-plugin": "^0.1.16", "component-playground": "^3.2.1", "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.28.4", - "enzyme": "^2.9.1", + "enzyme": "^3.7.0", "eslint": "^4.19.1", "eslint-config-prettier": "2.9.0", "eslint-plugin-prettier": "2.6.0", @@ -80,14 +81,14 @@ "mocha": "4.0.1", "prettier": "1.13", "raw-loader": "^0.5.1", - "react": "^15.6.1", + "react": "^16.6.3", "react-addons-update": "^15.6.0", "react-docgen": "2.17.0", - "react-dom": "^15.6.1", + "react-dom": "^16.6.3", "react-pure-render-debug": "^1.1.1", "react-router": "^4.1.2", "react-router-dom": "^4.1.2", - "react-test-renderer": "^15.6.2", + "react-test-renderer": "^16.6.3", "remark": "^8.0.0", "remark-react": "^5.0.0", "rewire": "^3.0.2", diff --git a/tests/jsdom/setup.js b/tests/jsdom/setup.js index 94f55a8d..5b2f6eb4 100644 --- a/tests/jsdom/setup.js +++ b/tests/jsdom/setup.js @@ -1,8 +1,7 @@ // see https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md -var jsdom = require("jsdom").jsdom; - -var exposedProperties = ["window", "navigator", "document"]; +const jsdom = require("jsdom").jsdom; +const exposedProperties = ["window", "navigator", "document"]; global.document = jsdom(""); global.window = document.defaultView; @@ -21,3 +20,8 @@ global.navigator = { // see also https://github.com/chaijs/type-detect/issues/98 global.HTMLElement = window.HTMLElement; global.SVGElement = function() {}; + +const enzyme = require("enzyme"); +const adapter = require("enzyme-adapter-react-16"); + +enzyme.configure({ adapter: new adapter() }); \ No newline at end of file From 5a62ad7d3e31e97f46b192027387dbb08365635d Mon Sep 17 00:00:00 2001 From: krissalvador27 Date: Wed, 5 Dec 2018 01:21:35 -0500 Subject: [PATCH 2/2] Fix proptypes issue & update tests for enzyme v3 --- docs/src/ExampleSection.js | 15 ++++++++------- tests/browser/spec/XAxisLabels.spec.js | 3 +-- tests/jsdom/spec/FunnelChart.spec.js | 4 ++-- tests/jsdom/spec/LineChart.spec.js | 8 ++++---- tests/jsdom/spec/TreeMap.spec.js | 8 ++++---- tests/jsdom/spec/XGrid.spec.js | 8 ++++++-- tests/jsdom/spec/XYPlot.spec.js | 8 ++++---- tests/jsdom/spec/YGrid.spec.js | 24 ++++++++++++------------ tests/jsdom/spec/ZoomContainer.spec.js | 8 ++++---- 9 files changed, 45 insertions(+), 41 deletions(-) diff --git a/docs/src/ExampleSection.js b/docs/src/ExampleSection.js index 1d3a6754..d7dfd9f3 100644 --- a/docs/src/ExampleSection.js +++ b/docs/src/ExampleSection.js @@ -1,5 +1,6 @@ import React from "react"; import ReactDOM from "react-dom"; +import PropTypes from "prop-types"; import _ from "lodash"; import moment from "moment"; import * as d3 from "d3"; @@ -18,13 +19,13 @@ window.Reactochart = Reactochart; export default class ExampleSection extends React.Component { static propTypes = { - codeText: React.PropTypes.string, - scope: React.PropTypes.object, - isExpanded: React.PropTypes.bool, - label: React.PropTypes.node, - id: React.PropTypes.string, - description: React.PropTypes.node, - onClick: React.PropTypes.func + codeText: PropTypes.string, + scope: PropTypes.object, + isExpanded: PropTypes.bool, + label: PropTypes.node, + id: PropTypes.string, + description: PropTypes.node, + onClick: PropTypes.func }; static defaultProps = { codeText: "", diff --git a/tests/browser/spec/XAxisLabels.spec.js b/tests/browser/spec/XAxisLabels.spec.js index edec95c9..ff1c95b8 100644 --- a/tests/browser/spec/XAxisLabels.spec.js +++ b/tests/browser/spec/XAxisLabels.spec.js @@ -85,8 +85,7 @@ describe("XAxisLabel", () => { const labelWrapper = rendered.first("g"); const labels = labelWrapper .children() - .find("text") - .getNodes(); + .find("text"); const correctTickLabels = ["-20%", "-10%", "0%", "10%", "20%"]; diff --git a/tests/jsdom/spec/FunnelChart.spec.js b/tests/jsdom/spec/FunnelChart.spec.js index 55de809f..8da066c2 100644 --- a/tests/jsdom/spec/FunnelChart.spec.js +++ b/tests/jsdom/spec/FunnelChart.spec.js @@ -41,13 +41,13 @@ describe("FunnelChart", () => { expect(group.find("path")).to.have.length(props.data.length - 1); group.find("path").forEach(path => { - const pathD = path.getNode().getAttribute("d"); + const pathD = path.instance().getAttribute("d"); expect(pathD).not.to.include("NaN"); }); const lastPath = group.find("path").last(); - const pathData = lastPath.getNode().getAttribute("d"); + const pathData = lastPath.instance().getAttribute("d"); expect(pathData).to.equal("M1140,12L390,15L-330,15L-1080,12Z"); }); diff --git a/tests/jsdom/spec/LineChart.spec.js b/tests/jsdom/spec/LineChart.spec.js index ddae23f7..62541243 100644 --- a/tests/jsdom/spec/LineChart.spec.js +++ b/tests/jsdom/spec/LineChart.spec.js @@ -59,7 +59,7 @@ describe("LineChart", () => { // ensure line is drawn as expected const chart = mount(); const path = chart.find("path"); - const pathData = path.getNode().getAttribute("d"); + const pathData = path.instance().getAttribute("d"); expect(pathData).to.equal("M0,50L50,0L100,75"); }); @@ -89,7 +89,7 @@ describe("LineChart", () => { // ensure line is drawn as expected const chart = mount(); const path = chart.find("path"); - const pathData = path.getNode().getAttribute("d"); + const pathData = path.instance().getAttribute("d"); expect(pathData).to.equal("M0,50L50,0L100,75"); }); @@ -112,7 +112,7 @@ describe("LineChart", () => { // ensure line is drawn as expected const chart = mount(); const path = chart.find("path"); - const pathData = path.getNode().getAttribute("d"); + const pathData = path.instance().getAttribute("d"); expect(pathData).to.equal("M0,50L50,0L100,75"); }); @@ -132,7 +132,7 @@ describe("LineChart", () => { const path = chart.find("path"); expect(path).to.have.length(1); - const pathData = path.getNode().getAttribute("d"); + const pathData = path.instance().getAttribute("d"); expect(pathData).not.to.include("NaN"); }); }); diff --git a/tests/jsdom/spec/TreeMap.spec.js b/tests/jsdom/spec/TreeMap.spec.js index d299edf3..9fedaeac 100644 --- a/tests/jsdom/spec/TreeMap.spec.js +++ b/tests/jsdom/spec/TreeMap.spec.js @@ -53,15 +53,15 @@ describe("TreeMap", () => { it("recreates tree when sticky is false, and keeps tree when true", () => { let chart = mount(); - let tree = chart.getNode()._tree; + let tree = chart.instance()._tree; chart.setProps({ data }); - expect(tree).to.not.equal(chart.getNode()._tree); + expect(tree).to.not.equal(chart.instance()._tree); chart = mount(); - tree = chart.getNode()._tree; + tree = chart.instance()._tree; chart.setProps({ data }); - expect(tree).to.eql(chart.getNode()._tree); + expect(tree).to.eql(chart.instance()._tree); }); it("triggers event handlers", () => { diff --git a/tests/jsdom/spec/XGrid.spec.js b/tests/jsdom/spec/XGrid.spec.js index 3698c22e..54e05766 100644 --- a/tests/jsdom/spec/XGrid.spec.js +++ b/tests/jsdom/spec/XGrid.spec.js @@ -22,9 +22,13 @@ describe("XGrid", () => { it("passes props correctly to XLine", () => { const xGrid = mount(); const xLines = xGrid.find(XLine); + const group = xGrid.find("g"); - xLines.getNodes().forEach(xLine => { - const xLineProps = xLine.props; + expect(group).to.have.lengthOf(1); + expect(group.getDOMNode().className).to.equal("rct-chart-grid-x"); + + xLines.forEach(xLine => { + const xLineProps = xLine.props(); expect(xLineProps.className).to.contain(props.lineClassName); expect(xLineProps.style).to.equal(props.lineStyle); diff --git a/tests/jsdom/spec/XYPlot.spec.js b/tests/jsdom/spec/XYPlot.spec.js index 8d65c21c..02795c45 100644 --- a/tests/jsdom/spec/XYPlot.spec.js +++ b/tests/jsdom/spec/XYPlot.spec.js @@ -27,13 +27,13 @@ describe("XYPlot", () => { expect(svg.getDOMNode().style._values).to.eql(commonXYProps.style); expect(plot.getDOMNode().style._values).to.eql(commonXYProps.xyPlotStyle); - const node = svg.getNode(); + const node = svg.instance(); expect(node.tagName.toLowerCase()).to.equal("svg"); expect(node.getAttribute("width")).to.equal("600"); expect(node.getAttribute("height")).to.equal("800"); const chart2 = mount(); - const node2 = chart2.find("svg").getNode(); + const node2 = chart2.find("svg").instance(); expect(node2.tagName.toLowerCase()).to.equal("svg"); expect(parseInt(node2.getAttribute("width"))) .to.be.a("number") @@ -54,8 +54,8 @@ describe("XYPlot", () => { const chart = mount( ); - const inner = chart.find(".rct-chart-inner").getNode(); - const bg = chart.find(".rct-plot-background").getNode(); + const inner = chart.find(".rct-chart-inner").instance(); + const bg = chart.find(".rct-plot-background").instance(); expect(inner.getAttribute("transform").replace(/\s/, "")).to.contain( `translate(${margin.marginLeft},${margin.marginTop})` ); diff --git a/tests/jsdom/spec/YGrid.spec.js b/tests/jsdom/spec/YGrid.spec.js index b7799f8b..2c9ac5a6 100644 --- a/tests/jsdom/spec/YGrid.spec.js +++ b/tests/jsdom/spec/YGrid.spec.js @@ -21,11 +21,11 @@ describe("YGrid", () => { it("passes props correctly to YLine", () => { const yGrid = mount(); - const xLines = yGrid.find(YLine); - - xLines.getNodes().forEach(yLine => { - const yLineProps = yLine.props; + const yLines = yGrid.find(YLine); + yLines.forEach(yLine => { + const yLineProps = yLine.props(); + expect(yLineProps.className).to.contain(props.lineClassName); expect(yLineProps.style).to.equal(props.lineStyle); expect(yLineProps.spacingTop).to.equal(props.spacingTop); @@ -39,28 +39,28 @@ describe("YGrid", () => { it("renders the correct amount of YLines given tickCount", () => { const tickCount = 50; - const xGrid = mount(); - const group = xGrid.find("g"); + const yGrid = mount(); + const group = yGrid.find("g"); expect(group).to.have.lengthOf(1); expect(group.getDOMNode().className).to.equal("rct-chart-grid-y"); - const xLines = xGrid.find(YLine); + const yLines = yGrid.find(YLine); const numTicksMade = getScaleTicks(props.yScale, null, tickCount); - expect(xLines).to.have.lengthOf(numTicksMade.length); + expect(yLines).to.have.lengthOf(numTicksMade.length); }); it("renders the correct amount of YLines given ticks", () => { const ticks = [0, 25, 50, 100]; - const xGrid = mount(); - const group = xGrid.find("g"); + const yGrid = mount(); + const group = yGrid.find("g"); expect(group).to.have.lengthOf(1); expect(group.getDOMNode().className).to.equal("rct-chart-grid-y"); - const xLines = xGrid.find(YLine); - expect(xLines).to.have.lengthOf(ticks.length); + const yLines = yGrid.find(YLine); + expect(yLines).to.have.lengthOf(ticks.length); }); it("getTickDomain works as expected", () => { diff --git a/tests/jsdom/spec/ZoomContainer.spec.js b/tests/jsdom/spec/ZoomContainer.spec.js index 1987abe5..115caf71 100644 --- a/tests/jsdom/spec/ZoomContainer.spec.js +++ b/tests/jsdom/spec/ZoomContainer.spec.js @@ -21,8 +21,8 @@ describe("ZoomContainer", () => { it("passes props correctly to DOM", () => { const zoomContainer = mount(); - let svg = zoomContainer.find("svg").getNode(); - let group = zoomContainer.find("g").getNode(); + let svg = zoomContainer.find("svg").instance(); + let group = zoomContainer.find("g").instance(); expect(parseInt(svg.getAttribute("width"))).to.equal( uncontrolledProps.width @@ -41,8 +41,8 @@ describe("ZoomContainer", () => { ); - svg = controlledZoomContainer.find("svg").getNode(); - group = controlledZoomContainer.find("g").getNode(); + svg = controlledZoomContainer.find("svg").instance(); + group = controlledZoomContainer.find("g").instance(); expect(parseInt(svg.getAttribute("width"))).to.equal(controlledProps.width); expect(parseInt(svg.getAttribute("height"))).to.equal(