diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1cc303671..11bab4677 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -31,15 +31,17 @@ Please check relevant options, delete irrelevant ones. - [ ] Translation Updates - [ ] Release -### TypeScript/Hooks Update +### Codebase Modernization - [ ] Updated files to React Hooks - [ ] Updated files to TypeScript +- [ ] Updated tests to React Testing Library ## Before / After diff --git a/package-lock.json b/package-lock.json index 0c886fb87..f7f82efa3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,8 @@ "@paystring/utils": "^2.0.0", "@redux-devtools/extension": "^3.3.0", "@rollup/plugin-inject": "^5.0.5", + "@testing-library/jest-dom": "^5.17.0", + "@testing-library/react": "^12.1.5", "@vitejs/plugin-react": "^4.2.1", "@xrplf/isomorphic": "^1.0.0-beta.1", "@xrplf/prettier-config": "^1.9.1", @@ -73,6 +75,8 @@ "@types/react": "^17.0.39", "@types/react-dom": "^17.0.9", "@types/react-redux": "^7.1.22", + "@types/react-router-dom": "^5.3.3", + "@types/testing-library__jest-dom": "^5.14.9", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^6.21.0", "babel-jest": "^29.7.0", @@ -127,6 +131,11 @@ "node": ">=0.10.0" } }, + "node_modules/@adobe/css-tools": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.3.tgz", + "integrity": "sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==" + }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", @@ -6080,6 +6089,255 @@ "@svgr/core": "*" } }, + "node_modules/@testing-library/dom": { + "version": "8.20.1", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-8.20.1.tgz", + "integrity": "sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g==", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.1.3", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@testing-library/dom/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/dom/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@testing-library/dom/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@testing-library/dom/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@testing-library/dom/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/@testing-library/dom/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/dom/node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@testing-library/dom/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@testing-library/dom/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" + }, + "node_modules/@testing-library/dom/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/jest-dom": { + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.17.0.tgz", + "integrity": "sha512-ynmNeT7asXyH3aSVv4vvX4Rb+0qjOhdNHnO/3vuZNqPmhDpV/+rCSGwQ7bLcmU2cJ4dvoheIO85LQj0IbJHEtg==", + "dependencies": { + "@adobe/css-tools": "^4.0.1", + "@babel/runtime": "^7.9.2", + "@types/testing-library__jest-dom": "^5.9.1", + "aria-query": "^5.0.0", + "chalk": "^3.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.5.6", + "lodash": "^4.17.15", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=8", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/@testing-library/jest-dom/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/react": { + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-12.1.5.tgz", + "integrity": "sha512-OfTXCJUFgjd/digLUuPxa0+/3ZxsQmE7ub9kcbW/wi96Bh3o/p5vrETcBGfP17NWPGqeYYl5LTRpwyGoMC4ysg==", + "dependencies": { + "@babel/runtime": "^7.12.5", + "@testing-library/dom": "^8.0.0", + "@types/react-dom": "<18.0.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "react": "<18.0.0", + "react-dom": "<18.0.0" + } + }, "node_modules/@tootallnate/once": { "version": "1.1.2", "dev": true, @@ -6113,6 +6371,11 @@ "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==" + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -6242,6 +6505,12 @@ "@types/node": "*" } }, + "node_modules/@types/history": { + "version": "4.7.11", + "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", + "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==", + "dev": true + }, "node_modules/@types/hoist-non-react-statics": { "version": "3.3.1", "license": "MIT", @@ -6252,12 +6521,10 @@ }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.3", - "dev": true, "license": "MIT" }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.0", - "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "*" @@ -6276,7 +6543,6 @@ "version": "26.0.24", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.24.tgz", "integrity": "sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w==", - "dev": true, "dependencies": { "jest-diff": "^26.0.0", "pretty-format": "^26.0.0" @@ -6310,7 +6576,6 @@ "version": "18.19.33", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.33.tgz", "integrity": "sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==", - "devOptional": true, "dependencies": { "undici-types": "~5.26.4" } @@ -6346,7 +6611,6 @@ }, "node_modules/@types/react-dom": { "version": "17.0.9", - "devOptional": true, "license": "MIT", "dependencies": { "@types/react": "*" @@ -6372,6 +6636,27 @@ "@babel/runtime": "^7.9.2" } }, + "node_modules/@types/react-router": { + "version": "5.1.20", + "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", + "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", + "dev": true, + "dependencies": { + "@types/history": "^4.7.11", + "@types/react": "*" + } + }, + "node_modules/@types/react-router-dom": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", + "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", + "dev": true, + "dependencies": { + "@types/history": "^4.7.11", + "@types/react": "*", + "@types/react-router": "*" + } + }, "node_modules/@types/scheduler": { "version": "0.16.2", "license": "MIT" @@ -6387,6 +6672,14 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/testing-library__jest-dom": { + "version": "5.14.9", + "resolved": "https://registry.npmjs.org/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.9.tgz", + "integrity": "sha512-FSYhIjFlfOpGSRyVoMBMuS3ws5ehFQODymf3vlI7U1K8c7PHwWwFY7VREfmsuzHSOnoKs/9/Y983ayOs7eRzqw==", + "dependencies": { + "@types/jest": "*" + } + }, "node_modules/@types/use-sync-external-store": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", @@ -6402,7 +6695,6 @@ }, "node_modules/@types/yargs-parser": { "version": "20.2.0", - "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -7312,7 +7604,6 @@ "version": "5.1.3", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", - "dev": true, "dependencies": { "deep-equal": "^2.0.5" } @@ -7345,7 +7636,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "dev": true, "dependencies": { "call-bind": "^1.0.5", "is-array-buffer": "^3.0.4" @@ -9576,6 +9866,11 @@ "url": "https://github.com/sponsors/fb55" } }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==" + }, "node_modules/cssesc": { "version": "3.0.0", "dev": true, @@ -10179,7 +10474,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz", "integrity": "sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==", - "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", @@ -10224,8 +10518,7 @@ "node_modules/deep-equal/node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/deep-is": { "version": "0.1.3", @@ -10383,7 +10676,6 @@ }, "node_modules/diff-sequences": { "version": "26.6.2", - "dev": true, "license": "MIT", "engines": { "node": ">= 10.14.2" @@ -10424,6 +10716,11 @@ "node": ">=6.0.0" } }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==" + }, "node_modules/dom-helpers": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", @@ -10882,7 +11179,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -10901,8 +11197,7 @@ "node_modules/es-get-iterator/node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/es-iterator-helpers": { "version": "1.0.19", @@ -13170,7 +13465,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -13527,7 +13821,6 @@ }, "node_modules/has-bigints": { "version": "1.0.2", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -13993,7 +14286,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "dev": true, "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.0", @@ -14072,7 +14364,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1" @@ -14105,7 +14396,6 @@ }, "node_modules/is-bigint": { "version": "1.0.4", - "dev": true, "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" @@ -14127,7 +14417,6 @@ }, "node_modules/is-boolean-object": { "version": "1.1.1", - "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.2" @@ -14216,7 +14505,6 @@ }, "node_modules/is-date-object": { "version": "1.0.5", - "dev": true, "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" @@ -14338,7 +14626,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -14383,7 +14670,6 @@ }, "node_modules/is-number-object": { "version": "1.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -14440,7 +14726,6 @@ }, "node_modules/is-regex": { "version": "1.1.4", - "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -14457,7 +14742,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -14466,7 +14750,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "dev": true, "dependencies": { "call-bind": "^1.0.7" }, @@ -14486,7 +14769,6 @@ }, "node_modules/is-string": { "version": "1.0.7", - "dev": true, "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" @@ -14505,7 +14787,6 @@ }, "node_modules/is-symbol": { "version": "1.0.4", - "dev": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" @@ -14539,7 +14820,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -14559,7 +14839,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -16094,7 +16373,6 @@ }, "node_modules/jest-diff": { "version": "26.6.2", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -16108,7 +16386,6 @@ }, "node_modules/jest-diff/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -16122,7 +16399,6 @@ }, "node_modules/jest-diff/node_modules/chalk": { "version": "4.1.1", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -16137,7 +16413,6 @@ }, "node_modules/jest-diff/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -16148,12 +16423,10 @@ }, "node_modules/jest-diff/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/jest-diff/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -16161,7 +16434,6 @@ }, "node_modules/jest-diff/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -16719,7 +16991,6 @@ }, "node_modules/jest-get-type": { "version": "26.3.0", - "dev": true, "license": "MIT", "engines": { "node": ">= 10.14.2" @@ -21714,6 +21985,14 @@ "node": ">=10" } }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -22125,7 +22404,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true, "engines": { "node": ">=4" } @@ -23286,7 +23564,6 @@ }, "node_modules/pretty-format": { "version": "26.6.2", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^26.6.2", @@ -23300,7 +23577,6 @@ }, "node_modules/pretty-format/node_modules/@jest/types": { "version": "26.6.2", - "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "^2.0.0", @@ -23315,7 +23591,6 @@ }, "node_modules/pretty-format/node_modules/@types/istanbul-reports": { "version": "3.0.1", - "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" @@ -23323,7 +23598,6 @@ }, "node_modules/pretty-format/node_modules/@types/yargs": { "version": "15.0.13", - "dev": true, "license": "MIT", "dependencies": { "@types/yargs-parser": "*" @@ -23331,7 +23605,6 @@ }, "node_modules/pretty-format/node_modules/ansi-regex": { "version": "5.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -23339,7 +23612,6 @@ }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -23353,7 +23625,6 @@ }, "node_modules/pretty-format/node_modules/chalk": { "version": "4.1.1", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -23368,7 +23639,6 @@ }, "node_modules/pretty-format/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -23379,12 +23649,10 @@ }, "node_modules/pretty-format/node_modules/color-name": { "version": "1.1.4", - "dev": true, "license": "MIT" }, "node_modules/pretty-format/node_modules/has-flag": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -23392,12 +23660,10 @@ }, "node_modules/pretty-format/node_modules/react-is": { "version": "17.0.2", - "dev": true, "license": "MIT" }, "node_modules/pretty-format/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -24027,7 +24293,6 @@ "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", - "dev": true, "dependencies": { "call-bind": "^1.0.6", "define-properties": "^1.2.1", @@ -24712,7 +24977,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -25456,7 +25720,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, "dependencies": { "internal-slot": "^1.0.4" }, @@ -27258,8 +27521,7 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "devOptional": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.1", @@ -28289,7 +28551,6 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", - "dev": true, "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", @@ -28338,7 +28599,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", - "dev": true, "dependencies": { "is-map": "^2.0.1", "is-set": "^2.0.1", @@ -28637,6 +28897,11 @@ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true }, + "@adobe/css-tools": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.3.tgz", + "integrity": "sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ==" + }, "@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", @@ -32527,6 +32792,186 @@ "svg-parser": "^2.0.4" } }, + "@testing-library/dom": { + "version": "8.20.1", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-8.20.1.tgz", + "integrity": "sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g==", + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.1.3", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "pretty-format": "^27.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "requires": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==" + } + } + }, + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@testing-library/jest-dom": { + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.17.0.tgz", + "integrity": "sha512-ynmNeT7asXyH3aSVv4vvX4Rb+0qjOhdNHnO/3vuZNqPmhDpV/+rCSGwQ7bLcmU2cJ4dvoheIO85LQj0IbJHEtg==", + "requires": { + "@adobe/css-tools": "^4.0.1", + "@babel/runtime": "^7.9.2", + "@types/testing-library__jest-dom": "^5.9.1", + "aria-query": "^5.0.0", + "chalk": "^3.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.5.6", + "lodash": "^4.17.15", + "redent": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "requires": { + "min-indent": "^1.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@testing-library/react": { + "version": "12.1.5", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-12.1.5.tgz", + "integrity": "sha512-OfTXCJUFgjd/digLUuPxa0+/3ZxsQmE7ub9kcbW/wi96Bh3o/p5vrETcBGfP17NWPGqeYYl5LTRpwyGoMC4ysg==", + "requires": { + "@babel/runtime": "^7.12.5", + "@testing-library/dom": "^8.0.0", + "@types/react-dom": "<18.0.0" + } + }, "@tootallnate/once": { "version": "1.1.2", "dev": true, @@ -32556,6 +33001,11 @@ "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, + "@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==" + }, "@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -32681,6 +33131,12 @@ "@types/node": "*" } }, + "@types/history": { + "version": "4.7.11", + "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", + "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==", + "dev": true + }, "@types/hoist-non-react-statics": { "version": "3.3.1", "requires": { @@ -32689,12 +33145,10 @@ } }, "@types/istanbul-lib-coverage": { - "version": "2.0.3", - "dev": true + "version": "2.0.3" }, "@types/istanbul-lib-report": { "version": "3.0.0", - "dev": true, "requires": { "@types/istanbul-lib-coverage": "*" } @@ -32711,7 +33165,6 @@ "version": "26.0.24", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.24.tgz", "integrity": "sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w==", - "dev": true, "requires": { "jest-diff": "^26.0.0", "pretty-format": "^26.0.0" @@ -32745,7 +33198,6 @@ "version": "18.19.33", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.33.tgz", "integrity": "sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==", - "devOptional": true, "requires": { "undici-types": "~5.26.4" } @@ -32776,7 +33228,6 @@ }, "@types/react-dom": { "version": "17.0.9", - "devOptional": true, "requires": { "@types/react": "*" } @@ -32802,6 +33253,27 @@ } } }, + "@types/react-router": { + "version": "5.1.20", + "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", + "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", + "dev": true, + "requires": { + "@types/history": "^4.7.11", + "@types/react": "*" + } + }, + "@types/react-router-dom": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", + "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", + "dev": true, + "requires": { + "@types/history": "^4.7.11", + "@types/react": "*", + "@types/react-router": "*" + } + }, "@types/scheduler": { "version": "0.16.2" }, @@ -32815,6 +33287,14 @@ "version": "1.0.1", "dev": true }, + "@types/testing-library__jest-dom": { + "version": "5.14.9", + "resolved": "https://registry.npmjs.org/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.9.tgz", + "integrity": "sha512-FSYhIjFlfOpGSRyVoMBMuS3ws5ehFQODymf3vlI7U1K8c7PHwWwFY7VREfmsuzHSOnoKs/9/Y983ayOs7eRzqw==", + "requires": { + "@types/jest": "*" + } + }, "@types/use-sync-external-store": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", @@ -32828,8 +33308,7 @@ } }, "@types/yargs-parser": { - "version": "20.2.0", - "dev": true + "version": "20.2.0" }, "@typescript-eslint/eslint-plugin": { "version": "7.0.0", @@ -33405,7 +33884,6 @@ "version": "5.1.3", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", - "dev": true, "requires": { "deep-equal": "^2.0.5" } @@ -33426,7 +33904,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "dev": true, "requires": { "call-bind": "^1.0.5", "is-array-buffer": "^3.0.4" @@ -34988,6 +35465,11 @@ "version": "5.0.1", "dev": true }, + "css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==" + }, "cssesc": { "version": "3.0.0", "dev": true @@ -35416,7 +35898,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz", "integrity": "sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==", - "dev": true, "requires": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", @@ -35441,8 +35922,7 @@ "isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" } } }, @@ -35562,8 +36042,7 @@ "dev": true }, "diff-sequences": { - "version": "26.6.2", - "dev": true + "version": "26.6.2" }, "dir-glob": { "version": "3.0.1", @@ -35589,6 +36068,11 @@ "esutils": "^2.0.2" } }, + "dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==" + }, "dom-helpers": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", @@ -35926,7 +36410,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -35942,8 +36425,7 @@ "isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" } } }, @@ -37490,8 +37972,7 @@ "functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==" }, "gauge": { "version": "2.7.4", @@ -37736,8 +38217,7 @@ } }, "has-bigints": { - "version": "1.0.2", - "dev": true + "version": "1.0.2" }, "has-flag": { "version": "3.0.0" @@ -38039,7 +38519,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "dev": true, "requires": { "es-errors": "^1.3.0", "hasown": "^2.0.0", @@ -38090,7 +38569,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "dev": true, "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1" @@ -38110,7 +38588,6 @@ }, "is-bigint": { "version": "1.0.4", - "dev": true, "requires": { "has-bigints": "^1.0.1" } @@ -38124,7 +38601,6 @@ }, "is-boolean-object": { "version": "1.1.1", - "dev": true, "requires": { "call-bind": "^1.0.2" } @@ -38179,7 +38655,6 @@ }, "is-date-object": { "version": "1.0.5", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -38248,8 +38723,7 @@ "is-map": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", - "dev": true + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==" }, "is-nan": { "version": "1.3.2", @@ -38283,8 +38757,7 @@ } }, "is-number-object": { - "version": "1.0.5", - "dev": true + "version": "1.0.5" }, "is-path-inside": { "version": "3.0.3", @@ -38312,7 +38785,6 @@ }, "is-regex": { "version": "1.1.4", - "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -38321,14 +38793,12 @@ "is-set": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", - "dev": true + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==" }, "is-shared-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "dev": true, "requires": { "call-bind": "^1.0.7" } @@ -38338,7 +38808,6 @@ }, "is-string": { "version": "1.0.7", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -38349,7 +38818,6 @@ }, "is-symbol": { "version": "1.0.4", - "dev": true, "requires": { "has-symbols": "^1.0.2" } @@ -38368,8 +38836,7 @@ "is-weakmap": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", - "dev": true + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==" }, "is-weakref": { "version": "1.0.2", @@ -38382,7 +38849,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", - "dev": true, "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -39779,7 +40245,6 @@ }, "jest-diff": { "version": "26.6.2", - "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^26.6.2", @@ -39789,14 +40254,12 @@ "dependencies": { "ansi-styles": { "version": "4.3.0", - "dev": true, "requires": { "color-convert": "^2.0.1" } }, "chalk": { "version": "4.1.1", - "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -39804,22 +40267,18 @@ }, "color-convert": { "version": "2.0.1", - "dev": true, "requires": { "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.4", - "dev": true + "version": "1.1.4" }, "has-flag": { - "version": "4.0.0", - "dev": true + "version": "4.0.0" }, "supports-color": { "version": "7.2.0", - "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -40208,8 +40667,7 @@ } }, "jest-get-type": { - "version": "26.3.0", - "dev": true + "version": "26.3.0" }, "jest-haste-map": { "version": "24.9.0", @@ -43392,6 +43850,11 @@ "yallist": "^4.0.0" } }, + "lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==" + }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -43655,8 +44118,7 @@ "min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" }, "minimatch": { "version": "3.1.2", @@ -44399,7 +44861,6 @@ }, "pretty-format": { "version": "26.6.2", - "dev": true, "requires": { "@jest/types": "^26.6.2", "ansi-regex": "^5.0.0", @@ -44409,7 +44870,6 @@ "dependencies": { "@jest/types": { "version": "26.6.2", - "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", @@ -44420,32 +44880,27 @@ }, "@types/istanbul-reports": { "version": "3.0.1", - "dev": true, "requires": { "@types/istanbul-lib-report": "*" } }, "@types/yargs": { "version": "15.0.13", - "dev": true, "requires": { "@types/yargs-parser": "*" } }, "ansi-regex": { - "version": "5.0.0", - "dev": true + "version": "5.0.0" }, "ansi-styles": { "version": "4.3.0", - "dev": true, "requires": { "color-convert": "^2.0.1" } }, "chalk": { "version": "4.1.1", - "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -44453,26 +44908,21 @@ }, "color-convert": { "version": "2.0.1", - "dev": true, "requires": { "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.4", - "dev": true + "version": "1.1.4" }, "has-flag": { - "version": "4.0.0", - "dev": true + "version": "4.0.0" }, "react-is": { - "version": "17.0.2", - "dev": true + "version": "17.0.2" }, "supports-color": { "version": "7.2.0", - "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -44894,7 +45344,6 @@ "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", - "dev": true, "requires": { "call-bind": "^1.0.6", "define-properties": "^1.2.1", @@ -45360,7 +45809,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, "requires": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -45871,7 +46319,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, "requires": { "internal-slot": "^1.0.4" } @@ -47097,8 +47544,7 @@ "undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "devOptional": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "unicode-canonical-property-names-ecmascript": { "version": "2.0.1", @@ -47697,7 +48143,6 @@ }, "which-boxed-primitive": { "version": "1.0.2", - "dev": true, "requires": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -47738,7 +48183,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", - "dev": true, "requires": { "is-map": "^2.0.1", "is-set": "^2.0.1", diff --git a/package.json b/package.json index f04822efe..f3572e258 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,8 @@ "@paystring/utils": "^2.0.0", "@redux-devtools/extension": "^3.3.0", "@rollup/plugin-inject": "^5.0.5", + "@testing-library/jest-dom": "^5.17.0", + "@testing-library/react": "^12.1.5", "@vitejs/plugin-react": "^4.2.1", "@xrplf/isomorphic": "^1.0.0-beta.1", "@xrplf/prettier-config": "^1.9.1", @@ -68,6 +70,8 @@ "@types/react": "^17.0.39", "@types/react-dom": "^17.0.9", "@types/react-redux": "^7.1.22", + "@types/react-router-dom": "^5.3.3", + "@types/testing-library__jest-dom": "^5.14.9", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^6.21.0", "babel-jest": "^29.7.0", diff --git a/src/containers/Accounts/AccountMPTTable/test/AccountMPTRow.test.tsx b/src/containers/Accounts/AccountMPTTable/test/AccountMPTRow.test.tsx index 04d9eb120..e8165c5a6 100644 --- a/src/containers/Accounts/AccountMPTTable/test/AccountMPTRow.test.tsx +++ b/src/containers/Accounts/AccountMPTTable/test/AccountMPTRow.test.tsx @@ -55,7 +55,7 @@ describe('AccountMPTRow', () => { '000017C2CE76E3E3328AE9E0D80CDD68BA72CC8D8D053DB6', ) expect(wrapper.find('td').at(1).html()).toBe( - 'rKFgd9FNzwu7a7iVYa2Me4dmBC3zzUepSC', + 'rKFgd9FNzwu7a7iVYa2Me4dmBC3zzUepSC', ) expect(wrapper.find('td').at(2).html()).toBe('0.100') wrapper.unmount() diff --git a/src/containers/Transactions/simpleTab.scss b/src/containers/Transactions/simpleTab.scss index ca374a592..4f1191505 100644 --- a/src/containers/Transactions/simpleTab.scss +++ b/src/containers/Transactions/simpleTab.scss @@ -68,7 +68,7 @@ $subdued-color: $black-40; &.list { margin-bottom: 12px; - .one-line{ + .one-line { justify-content: flex-end; margin: -1px 0px 0px; } diff --git a/src/containers/Transactions/test/Meta.test.tsx b/src/containers/Transactions/test/Meta.test.tsx index ac4195799..82309d475 100644 --- a/src/containers/Transactions/test/Meta.test.tsx +++ b/src/containers/Transactions/test/Meta.test.tsx @@ -35,7 +35,7 @@ describe('TransactionMeta container', () => { expect(w.find('li').length).toBe(23) expect(w.find('li').at(0).html()).toBe( - '
  • owned_account_root rUmustd4TbkjaEuS7S1damozpBEREgRz9z
  • ', + '
  • owned_account_root rUmustd4TbkjaEuS7S1damozpBEREgRz9z
  • ', ) expect(w.find('li').at(1).html()).toBe( @@ -43,7 +43,7 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(2).html()).toBe( - '
  • owned_account_root rPt8rwFrsucmjdKfjwRHGz9iZGxxN2cLYh
  • ', + '
  • owned_account_root rPt8rwFrsucmjdKfjwRHGz9iZGxxN2cLYh
  • ', ) expect(w.find('li').at(3).html()).toBe( @@ -51,7 +51,7 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(4).html()).toBe( - '
  • owned_account_root rEGoBvzusE2MkDn3yrgZc817XiwRofqoJq
  • ', + '
  • owned_account_root rEGoBvzusE2MkDn3yrgZc817XiwRofqoJq
  • ', ) expect(w.find('li').at(5).html()).toBe( @@ -59,11 +59,11 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(6).html()).toBe( - '
  • transaction_owned_directory
  • ', + '
  • transaction_owned_directory
  • ', ) expect(w.find('li').at(7).html()).toBe( - '
  • It modified a XRP/CNYowned byrEGoBvzusE2MkDn3yrgZc817XiwRofqoJqwith sequence # 1181517
  • ', + '
  • It modified a XRP/CNYowned byrEGoBvzusE2MkDn3yrgZc817XiwRofqoJqwith sequence # 1181517
  • ', ) expect(w.find('li').at(8).html()).toBe( @@ -75,11 +75,11 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(10).html()).toBe( - '
  • TakerGets CNY.rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y decreased byCN¥224.7141103fromCN¥2,100.12079671toCN¥1,875.40668641
  • ', + '
  • TakerGets CNY.rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y decreased byCN¥224.7141103fromCN¥2,100.12079671toCN¥1,875.40668641
  • ', ) expect(w.find('li').at(11).html()).toBe( - '
  • It modified a XRP/CNYowned byrUmustd4TbkjaEuS7S1damozpBEREgRz9zwith sequence # 5804
  • ', + '
  • It modified a XRP/CNYowned byrUmustd4TbkjaEuS7S1damozpBEREgRz9zwith sequence # 5804
  • ', ) expect(w.find('li').at(12).html()).toBe( @@ -87,7 +87,7 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(13).html()).toBe( - '
  • TakerPays CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA decreased byCN¥225.45293634fromCN¥12,589.58241408toCN¥12,364.12947774
  • ', + '
  • TakerPays CNY.razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA decreased byCN¥225.45293634fromCN¥12,589.58241408toCN¥12,364.12947774
  • ', ) expect(w.find('li').at(14).html()).toBe( @@ -95,7 +95,7 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(15).html()).toBe( - '
  • It modified a CNYripplestate node betweenrUmustd4TbkjaEuS7S1damozpBEREgRz9zandrazqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA
  • ', + '
  • It modified a CNYripplestate node betweenrUmustd4TbkjaEuS7S1damozpBEREgRz9zandrazqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA
  • ', ) expect(w.find('li').at(16).html()).toBe( @@ -103,7 +103,7 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(17).html()).toBe( - '
  • It modified a CNYripplestate node betweenrPt8rwFrsucmjdKfjwRHGz9iZGxxN2cLYhandrKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y
  • ', + '
  • It modified a CNYripplestate node betweenrPt8rwFrsucmjdKfjwRHGz9iZGxxN2cLYhandrKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y
  • ', ) expect(w.find('li').at(18).html()).toBe( @@ -111,7 +111,7 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(19).html()).toBe( - '
  • It modified a CNYripplestate node betweenrEGoBvzusE2MkDn3yrgZc817XiwRofqoJqandrKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y
  • ', + '
  • It modified a CNYripplestate node betweenrEGoBvzusE2MkDn3yrgZc817XiwRofqoJqandrKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y
  • ', ) expect(w.find('li').at(20).html()).toBe( @@ -119,7 +119,7 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(21).html()).toBe( - '
  • It modified a CNYripplestate node betweenrazqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXAandrPt8rwFrsucmjdKfjwRHGz9iZGxxN2cLYh
  • ', + '
  • It modified a CNYripplestate node betweenrazqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXAandrPt8rwFrsucmjdKfjwRHGz9iZGxxN2cLYh
  • ', ) expect(w.find('li').at(22).html()).toBe( @@ -174,7 +174,7 @@ describe('TransactionMeta container', () => { expect(w.find('li').length).toBe(6) expect(w.find('li').at(2).html()).toBe( - '
  • It modified an MPToken node ofrnNkvddM96FE2QsaFztLAn5xicjq5d6d8d
  • ', + '
  • It modified an MPToken node ofrnNkvddM96FE2QsaFztLAn5xicjq5d6d8d
  • ', ) expect(w.find('li').at(3).html()).toBe( @@ -182,7 +182,7 @@ describe('TransactionMeta container', () => { ) expect(w.find('li').at(4).html()).toBe( - '
  • It modified an MPTokenIssuance node ofrwREfyDU1SbcjN3xXZDbm8uNJV77T2ruKw
  • ', + '
  • It modified an MPTokenIssuance node ofrwREfyDU1SbcjN3xXZDbm8uNJV77T2ruKw
  • ', ) expect(w.find('li').at(5).html()).toBe( diff --git a/src/containers/shared/components/Account.tsx b/src/containers/shared/components/Account.tsx index fa102ff39..c27f17ec3 100644 --- a/src/containers/shared/components/Account.tsx +++ b/src/containers/shared/components/Account.tsx @@ -17,6 +17,7 @@ export const Account = (props: AccountProps) => { {link ? ( { {parts[0]} ) : ( - + {parts[0]} )} - {computedTag && :{computedTag}} + {computedTag && ( + + :{computedTag} + + )} ) } diff --git a/src/containers/shared/components/Amount.tsx b/src/containers/shared/components/Amount.tsx index e7fe6ecd5..cea44a8a2 100644 --- a/src/containers/shared/components/Amount.tsx +++ b/src/containers/shared/components/Amount.tsx @@ -34,8 +34,8 @@ export const Amount = ({ const options = { ...CURRENCY_OPTIONS, currency } const renderAmount = (localizedAmount) => ( - - + + {modifier && {modifier}} {localizedAmount} {' '} diff --git a/src/containers/shared/components/Currency.tsx b/src/containers/shared/components/Currency.tsx index ac48efa7c..cb85a8f70 100644 --- a/src/containers/shared/components/Currency.tsx +++ b/src/containers/shared/components/Currency.tsx @@ -28,17 +28,22 @@ const Currency = (props: Props) => { displaySymbol = true, isMPT = false, } = props - let content + let content: string if (isMPT) { const display = `MPT (${currency})` - content = link ? ( - - {display} - - ) : ( - display - ) + if (link) + return ( + + {display} + + ) + content = display } else { const currencyCode = currency?.length === NON_STANDARD_CODE_LENGTH && @@ -57,17 +62,25 @@ const Currency = (props: Props) => { display += shortenIssuer ? issuer.substring(0, 4) : issuer } - content = - link && issuer ? ( - + if (link && issuer) + return ( + {display} - ) : ( - display ) + content = display } - return {content} + return ( + + {content} + + ) } export const hexToString = (hex: string) => { diff --git a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx index 29672c26c..fdaa7079e 100644 --- a/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx +++ b/src/containers/shared/components/Transaction/DepositPreauth/test/DepositPreauthDescription.test.tsx @@ -12,7 +12,7 @@ describe('DepositPreauth: Description', () => { it('renders description for authorize', () => { const wrapper = createWrapper(mockDepositPreaut) expect(wrapper.html()).toBe( - `
    It authorizes to send payments to this account
    `, + `
    It authorizes to send payments to this account
    `, ) wrapper.unmount() }) @@ -20,7 +20,7 @@ describe('DepositPreauth: Description', () => { it('renders description for unauthorize', () => { const wrapper = createWrapper(mockDepositPreauthUnauthorize) expect(wrapper.html()).toBe( - `
    It removes the authorization for to send payments to this account
    `, + `
    It removes the authorization for to send payments to this account
    `, ) wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx index d4d4a3776..25af99edc 100644 --- a/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCancel/test/EscrowCancelDescription.test.tsx @@ -8,7 +8,7 @@ describe('EscrowCancelDescription', () => { it('renders description for EscrowCancel', () => { const wrapper = createWrapper(EscrowCancel) expect(wrapper.html()).toBe( - '
    escrow_cancellation_desc
    The escrowed amount of\uE900135.79XRPwas returned to (\uE900135.78999XRP escrow_after_transaction_cost)
    The escrow was created bywith transactionA979AD...', + '
    escrow_cancellation_desc
    The escrowed amount of\uE900135.79XRPwas returned to (\uE900135.78999XRP escrow_after_transaction_cost)
    The escrow was created bywith transactionA979AD...', ) wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx index d55fa71f6..0c256b19e 100644 --- a/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowCreate/test/EscrowCreateDescription.test.tsx @@ -8,7 +8,7 @@ describe('EscrowCreateDescription', () => { it('renders description for EscrowCreate', () => { const wrapper = createWrapper(EscrowCreate) expect(wrapper.html()).toBe( - 'The escrow is fromto
    escrow_condition A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120
    escrowed_amount \uE900997.50XRP
    describe_cancel_after March 1, 2020 at 8:54:20 AM UTC
    describe_finish_after March 1, 2020 at 9:01:00 AM UTC
    ', + 'The escrow is fromto
    escrow_condition A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120
    escrowed_amount \uE900997.50XRP
    describe_cancel_after March 1, 2020 at 8:54:20 AM UTC
    describe_finish_after March 1, 2020 at 9:01:00 AM UTC
    ', ) wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx index eba92bc6e..558762aa2 100644 --- a/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx +++ b/src/containers/shared/components/Transaction/EscrowFinish/test/EscrowFinishDescription.test.tsx @@ -8,7 +8,7 @@ describe('EscrowFinishDescription', () => { it('renders description for EscrowFinish', () => { const wrapper = createWrapper(EscrowFinish) expect(wrapper.html()).toBe( - '
    escrow_completion_desc
    The escrowed amount of\uE9000.0154XRPwas delivered to (\uE9000.015388XRP escrow_after_transaction_cost)
    The escrow was created bywith transaction3E2E75...
    escrow_finish_fullfillment_desc Fulfillment
    ', + '
    escrow_completion_desc
    The escrowed amount of\uE9000.0154XRPwas delivered to (\uE9000.015388XRP escrow_after_transaction_cost)
    The escrow was created bywith transaction3E2E75...
    escrow_finish_fullfillment_desc Fulfillment
    ', ) wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.jsx b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx similarity index 100% rename from src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.jsx rename to src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/NFTokenAcceptOfferSimple.test.tsx diff --git a/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.jsx b/src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx similarity index 100% rename from src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.jsx rename to src/containers/shared/components/Transaction/NFTokenBurn/test/NFTokenBurnSimple.test.tsx diff --git a/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.jsx b/src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx similarity index 100% rename from src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.jsx rename to src/containers/shared/components/Transaction/NFTokenCancelOffer/test/NFTokenCancelOfferSimple.test.tsx diff --git a/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.jsx b/src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx similarity index 100% rename from src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.jsx rename to src/containers/shared/components/Transaction/NFTokenCreateOffer/test/NFTokenCreateOfferSimple.test.tsx diff --git a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.jsx b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx similarity index 99% rename from src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.jsx rename to src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx index 0ce68de1c..1da139efa 100644 --- a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.jsx +++ b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx @@ -144,7 +144,7 @@ describe('NFTokenMint', () => { 'token-uri', convertHexToString( '516D5071416B3677777577796A71654C476F64665253375156774677394346736A6D363375485661556438387463', - ), + ) as string, ) wrapper.unmount() }) @@ -182,7 +182,7 @@ describe('NFTokenMint', () => { 'token-uri', convertHexToString( '516D5071416B3677777577796A71654C476F64665253375156774677394346736A6D363375485661556438387463', - ), + ) as string, ) wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx index 25d08654c..fd467dcde 100644 --- a/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx +++ b/src/containers/shared/components/Transaction/OfferCreate/test/OfferCreateDescription.test.tsx @@ -10,7 +10,7 @@ describe('OfferCreate: Description', () => { const wrapper = createWrapper(OfferCreate) expect(wrapper.html()).toBe( - '
    The accountoffered to pay1,080,661.95882CSCin order to receive\uE9001,764.293151XRP
    offer_create_desc_line_2 612.52XRP/CSC
    offer_create_desc_line_3 44866443
    The offer expiresMay 18, 2022 at 5:28:16 PM UTCunless cancelled before', + '
    The accountoffered to pay1,080,661.95882CSCin order to receive\uE9001,764.293151XRP
    offer_create_desc_line_2 612.52XRP/CSC
    offer_create_desc_line_3 44866443
    The offer expiresMay 18, 2022 at 5:28:16 PM UTCunless cancelled before', ) wrapper.unmount() }) @@ -19,7 +19,7 @@ describe('OfferCreate: Description', () => { const wrapper = createWrapper(OfferCreateInvertedCurrencies) expect(wrapper.html()).toBe( - '
    The accountoffered to pay\uE90017,588.363594XRPin order to receive$6,101.33033905USD
    offer_create_desc_line_2 0.34690XRP/USD
    offer_create_desc_line_3 80543309
    ', + '
    The accountoffered to pay\uE90017,588.363594XRPin order to receive$6,101.33033905USD
    offer_create_desc_line_2 0.34690XRP/USD
    offer_create_desc_line_3 80543309
    ', ) wrapper.unmount() }) diff --git a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx index e9331d2a4..c1826319f 100644 --- a/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx +++ b/src/containers/shared/components/Transaction/TrustSet/test/TrustSetDescription.test.tsx @@ -11,7 +11,7 @@ describe('TrustSet: Description', () => { it('renders description for authorize', () => { const wrapper = createWrapper(mockTrustSet) expect(wrapper.html()).toBe( - `
    It establishes CN¥1,000,000,000.00 as the maximum amount of CNY from that is willing to hold
    `, + `
    It establishes CN¥1,000,000,000.00 as the maximum amount of CNY from that is willing to hold
    `, ) wrapper.unmount() }) diff --git a/src/containers/shared/components/test/Account.test.tsx b/src/containers/shared/components/test/Account.test.tsx index 50e48f5c9..958463089 100644 --- a/src/containers/shared/components/test/Account.test.tsx +++ b/src/containers/shared/components/test/Account.test.tsx @@ -1,104 +1,75 @@ -import { mount } from 'enzyme' import { I18nextProvider } from 'react-i18next' import { BrowserRouter } from 'react-router-dom' +import { cleanup, render, screen } from '@testing-library/react' import i18n from '../../../../i18n/testConfig' import { Account } from '../Account' -const createWrapper = (component: JSX.Element) => - mount( +const renderComponent = (component: JSX.Element) => + render( {component} , ) +const ACCOUNT = 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt' +const ACCOUNT_PLUS_DT = `${ACCOUNT}:381702` + describe('Account', () => { + afterEach(cleanup) it('should render with a link', () => { - const wrapper = createWrapper( - , - ) - const anchor = wrapper.find('a') - expect(anchor).toHaveClassName('account') - expect(anchor).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(anchor).toHaveProp( - 'href', - '/accounts/rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt', - ) - expect(anchor).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(wrapper.find('.dt')).not.toExist() - wrapper.unmount() + renderComponent() + const element = screen.getByTestId('account') + expect(element).toHaveClass('account') + expect(element).toHaveTextContent(ACCOUNT) + expect(element).toHaveAttribute('href', `/accounts/${ACCOUNT}`) + expect(element).toHaveAttribute('title', ACCOUNT) + expect(screen.queryByTestId('dt')).toBeNull() }) it('should render without a link', () => { - const wrapper = createWrapper( - , - ) - const address = wrapper.find('.account').hostNodes() - expect(address).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(address).not.toHaveDisplayName('a') - expect(address).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(wrapper.find('.dt')).not.toExist() - wrapper.unmount() + renderComponent() + const element = screen.getByTestId('account') + expect(element).toHaveTextContent(ACCOUNT) + expect(element).not.toHaveAttribute('href') + expect(element).toHaveAttribute('title', ACCOUNT) + expect(screen.queryByTestId('dt')).toBeNull() }) it('should render with a destination tag', () => { - const wrapper = createWrapper( - , - ) - const anchor = wrapper.find('a') - expect(anchor).toHaveClassName('account') - expect(anchor).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(anchor).toHaveProp( - 'href', - '/accounts/rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt', - ) - expect(anchor).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(wrapper.find('.dt')).toHaveText(':381702') - wrapper.unmount() + renderComponent() + const element = screen.getByTestId('account') + expect(element).toHaveClass('account') + expect(element).toHaveTextContent(ACCOUNT) + expect(element).toHaveAttribute('href', `/accounts/${ACCOUNT}`) + expect(element).toHaveAttribute('title', ACCOUNT) + expect(screen.queryByTestId('dt')).toHaveTextContent(':381702') }) it('should render with a destination tag and no link', () => { - const wrapper = createWrapper( - , - ) - const address = wrapper.find('.account') - expect(address).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(address).not.toHaveDisplayName('a') - expect(address).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(wrapper.find('.dt')).toHaveText(':381702') - wrapper.unmount() + renderComponent() + const element = screen.getByTestId('account') + expect(element).toHaveClass('account') + expect(element).toHaveTextContent(ACCOUNT) + expect(element).not.toHaveAttribute('href') + expect(element).toHaveAttribute('title', ACCOUNT) + expect(screen.queryByTestId('dt')).toHaveTextContent(':381702') }) it('should render with a destination tag supplied separately', () => { - const wrapper = createWrapper( - , - ) - const anchor = wrapper.find('a') - expect(anchor).toHaveClassName('account') - expect(anchor).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(anchor).toHaveProp( - 'href', - '/accounts/rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt', - ) - expect(anchor).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(wrapper.find('.dt')).toHaveText(':123') - wrapper.unmount() + renderComponent() + const element = screen.getByTestId('account') + expect(element).toHaveClass('account') + expect(element).toHaveTextContent(ACCOUNT) + expect(element).toHaveAttribute('href', `/accounts/${ACCOUNT}`) + expect(element).toHaveAttribute('title', ACCOUNT) + expect(screen.queryByTestId('dt')).toHaveTextContent(':123') }) it('should render with a destination tag supplied separately and no link', () => { - const wrapper = createWrapper( - , - ) - const address = wrapper.find('.account') - expect(address).toHaveText('rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(address).not.toHaveDisplayName('a') - expect(address).toHaveProp('title', 'rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt') - expect(wrapper.find('.dt')).toHaveText(':123') - wrapper.unmount() + renderComponent() + const element = screen.getByTestId('account') + expect(element).toHaveTextContent(ACCOUNT) + expect(element).not.toHaveAttribute('href') + expect(element).toHaveAttribute('title', ACCOUNT) + expect(screen.queryByTestId('dt')).toHaveTextContent(':123') }) }) diff --git a/src/containers/shared/components/test/Amount.test.tsx b/src/containers/shared/components/test/Amount.test.tsx index 749f62033..a1c226587 100644 --- a/src/containers/shared/components/test/Amount.test.tsx +++ b/src/containers/shared/components/test/Amount.test.tsx @@ -1,6 +1,6 @@ import { I18nextProvider } from 'react-i18next' import { BrowserRouter } from 'react-router-dom' -import { mount } from 'enzyme' +import { cleanup, render, screen } from '@testing-library/react' import { useQuery } from 'react-query' import { Amount } from '../Amount' import i18n from '../../../../i18n/testConfig' @@ -11,8 +11,9 @@ jest.mock('react-query', () => ({ })) describe('Amount', () => { - const createWrapper = (component: JSX.Element) => - mount( + afterEach(cleanup) + const renderComponent = (component: JSX.Element) => + render( {component} , @@ -25,12 +26,13 @@ describe('Amount', () => { issuer: 'rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E', } - const wrapper = createWrapper() - expect(wrapper.find('.currency').text()).toEqual( + renderComponent() + expect(screen.getByTestId('currency')).toHaveTextContent( 'DYM.rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E', ) - expect(wrapper.find('.amount-localized').text()).toEqual('95.13258523') - wrapper.unmount() + expect(screen.getByTestId('amount-localized')).toHaveTextContent( + '95.13258523', + ) }) it('handles currency codes with standard symbols', () => { @@ -40,25 +42,29 @@ describe('Amount', () => { issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B', } - const wrapper = createWrapper() - expect(wrapper.find('.currency').text()).toEqual( + renderComponent() + expect(screen.getByTestId('currency')).toHaveTextContent( 'JPY.rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B', ) - expect(wrapper.find('.amount-localized').text()).toEqual('¥4,986.30908733') - wrapper.unmount() + expect(screen.getByTestId('amount-localized')).toHaveTextContent( + '¥4,986.30908733', + ) + }) + it('handles currency codes with standard symbols', () => { const value2 = { amount: 78.5098894970562, currency: 'GBP', issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B', } - const wrapper2 = createWrapper() - expect(wrapper2.find('.currency').text()).toEqual( + renderComponent() + expect(screen.getByTestId('currency')).toHaveTextContent( 'GBP.rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B', ) - expect(wrapper2.find('.amount-localized').text()).toEqual('£78.5098895') - wrapper2.unmount() + expect(screen.getByTestId('amount-localized')).toHaveTextContent( + '£78.5098895', + ) }) it('handles currency codes that are 4 characters ', () => { @@ -68,12 +74,13 @@ describe('Amount', () => { issuer: 'rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E', } - const wrapper = createWrapper() - expect(wrapper.find('.currency').text()).toEqual( + renderComponent() + expect(screen.getByTestId('currency')).toHaveTextContent( 'WOOT.rGwUWgN5BEg3QGNY3RX2HfYowjUTZdid3E', ) - expect(wrapper.find('.amount-localized').text()).toEqual('95.13258523') - wrapper.unmount() + expect(screen.getByTestId('amount-localized')).toHaveTextContent( + '95.13258523', + ) }) it('handles currency codes that are 40 characters ', () => { @@ -82,12 +89,13 @@ describe('Amount', () => { currency: '0158415500000000C1F76FF6ECB0BAC600000000', issuer: 'rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67', } - const wrapper = createWrapper() - expect(wrapper.find('.currency').text()).toEqual( + renderComponent() + expect(screen.getByTestId('currency')).toHaveTextContent( 'XAUÁ÷oöì°ºÆ.rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67', ) - expect(wrapper.find('.amount-localized').text()).toEqual('3.6923854') - wrapper.unmount() + expect(screen.getByTestId('amount-localized')).toHaveTextContent( + '3.6923854', + ) }) it('handles currency codes that are 40 characters and hidden issuer', () => { @@ -96,32 +104,29 @@ describe('Amount', () => { currency: '0158415500000000C1F76FF6ECB0BAC600000000', issuer: 'rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67', } - const wrapper = createWrapper( - , + renderComponent() + expect(screen.getByTestId('currency')).toHaveTextContent('XAUÁ÷oöì°ºÆ') + expect(screen.getByTestId('amount-localized')).toHaveTextContent( + '3.6923854', ) - expect(wrapper.find('.currency').text()).toEqual('XAUÁ÷oöì°ºÆ') - expect(wrapper.find('.amount-localized').text()).toEqual('3.6923854') - wrapper.unmount() }) it('handles XRP-style amounts', () => { const value = '1000' - const wrapper = createWrapper( - , + renderComponent() + expect(screen.getByTestId('currency')).toHaveTextContent('XRP') + expect(screen.getByTestId('amount-localized')).toHaveTextContent( + '\uE9000.001', ) - expect(wrapper.find('.currency').text()).toEqual('XRP') - expect(wrapper.find('.amount-localized').text()).toEqual('\uE9000.001') - wrapper.unmount() }) it('handles modifier', () => { const value = '9000' - const wrapper = createWrapper( - , + renderComponent() + expect(screen.getByTestId('currency')).toHaveTextContent('XRP') + expect(screen.getByTestId('amount-localized')).toHaveTextContent( + '+\uE9000.009', ) - expect(wrapper.find('.currency').text()).toEqual('XRP') - expect(wrapper.find('.amount-localized').text()).toEqual('+\uE9000.009') - wrapper.unmount() }) it('handles MPT amount', async () => { @@ -146,11 +151,11 @@ describe('Amount', () => { currency: '0000098F03B3BCE934EE8CAA1DF25A42032388361B9E5A65', isMPT: true, } - const wrapper = createWrapper( - , - ) + renderComponent() + screen.debug() - expect(wrapper.find('.amount-localized').text()).toEqual('1,043.001') - wrapper.unmount() + expect(screen.getByTestId('amount-localized')).toHaveTextContent( + '1,043.001', + ) }) }) diff --git a/src/containers/shared/components/test/Currency.test.tsx b/src/containers/shared/components/test/Currency.test.tsx index 8d7de259c..4a9ab3114 100644 --- a/src/containers/shared/components/test/Currency.test.tsx +++ b/src/containers/shared/components/test/Currency.test.tsx @@ -1,38 +1,41 @@ import { BrowserRouter } from 'react-router-dom' -import { mount } from 'enzyme' +import { cleanup, render, screen } from '@testing-library/react' import Currency from '../Currency' describe('Currency', () => { + afterEach(cleanup) it('handles currency codes that are 3 characters ', () => { - const wrapper = mount() - expect(wrapper.find('.currency').text()).toEqual('BTC') - wrapper.unmount() + render() + const element = screen.getByTestId('currency') + expect(element).toHaveClass('currency') + expect(element).toHaveTextContent('BTC') }) it('handles currency codes that are 4 characters ', () => { - const wrapper = mount() - expect(wrapper.find('.currency').text()).toEqual('WOOT') - wrapper.unmount() + render() + const element = screen.getByTestId('currency') + expect(element).toHaveClass('currency') + expect(element).toHaveTextContent('WOOT') }) it('handles currency codes that are 4 characters and include issuer ', () => { - const wrapper = mount( + render( , ) - expect(wrapper.find('.currency').text()).toEqual('USD.davi') - wrapper.unmount() + const element = screen.getByTestId('currency') + expect(element).toHaveClass('currency') + expect(element).toHaveTextContent('USD.davi') }) it('handles currency codes that are 40 characters ', () => { - const wrapper = mount( - , - ) - expect(wrapper.find('.currency').text()).toEqual('XMETA') - wrapper.unmount() + render() + const element = screen.getByTestId('currency') + expect(element).toHaveClass('currency') + expect(element).toHaveTextContent('XMETA') }) it('handles currency codes that are 40 characters and issuer ', () => { - const wrapper = mount( + render( { , ) - const meta = wrapper.find('.currency').at(0) - const usd = wrapper.find('.currency').at(1) + const elements = screen.getAllByTestId('currency') + expect(elements).toHaveLength(2) + expect(elements[0]).toHaveClass('currency') + expect(elements[1]).toHaveClass('currency') + + const meta = elements[0] + const usd = elements[1] - expect(meta).toHaveText('XMETA.r3XwJ1hr1PtbRvbhuUkybV6tmYzzA11WcB') - expect(meta.find('a')).toHaveProp( + expect(meta).toHaveTextContent('XMETA.r3XwJ1hr1PtbRvbhuUkybV6tmYzzA11WcB') + expect(meta).toHaveAttribute( 'href', '/token/584D455441000000000000000000000000000000.r3XwJ1hr1PtbRvbhuUkybV6tmYzzA11WcB', ) - expect(usd).toHaveText('USD.rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq') - expect(usd.find('a')).toHaveProp( + expect(usd).toHaveTextContent('USD.rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq') + expect(usd).toHaveAttribute( 'href', '/token/USD.rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq', ) - wrapper.unmount() }) it('displays the XRP symbol when rendering XRP', () => { - const wrapper = mount() - expect(wrapper.find('.currency').text()).toEqual('\uE900 XRP') - wrapper.unmount() + render() + const element = screen.getByTestId('currency') + expect(element).toHaveClass('currency') + expect(element).toHaveTextContent('\uE900 XRP') }) it('handles MPT ID ', () => { - const wrapper = mount( + render( { /> , ) - const mpt = wrapper.find('.currency').at(0) + const mpt = screen.getByTestId('currency') - expect(mpt).toHaveText( + expect(mpt).toHaveTextContent( 'MPT (00000BDE5B4F868ECE457207E2C1750065987730B8839E0D)', ) - expect(mpt.find('a')).toHaveProp( + expect(mpt).toHaveAttribute( 'href', '/mpt/00000BDE5B4F868ECE457207E2C1750065987730B8839E0D', ) - wrapper.unmount() }) }) diff --git a/src/setupTests.ts b/src/setupTests.ts index e92887b90..722be5464 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -1,5 +1,6 @@ import 'dotenv/config' import 'jest-enzyme' +import '@testing-library/jest-dom/extend-expect' import { configure } from 'enzyme' import Adapter from 'enzyme-adapter-react-17-updated' diff --git a/tsconfig.json b/tsconfig.json index 34d66a11f..6d7cc1f1c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,7 @@ "dom.iterable", "esnext" ], - "types": ["jest"], + "types": ["jest", "@testing-library/jest-dom"], "typeRoots": [ "./node_modules/@types", "./@types"