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 774723f74..aec45a0f3 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", @@ -5895,6 +5904,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, @@ -5928,6 +6186,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", @@ -6056,6 +6319,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", @@ -6066,12 +6335,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": "*" @@ -6090,7 +6357,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" @@ -6160,7 +6426,6 @@ }, "node_modules/@types/react-dom": { "version": "17.0.9", - "devOptional": true, "license": "MIT", "dependencies": { "@types/react": "*" @@ -6186,6 +6451,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" @@ -6201,6 +6487,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", @@ -6216,7 +6510,6 @@ }, "node_modules/@types/yargs-parser": { "version": "20.2.0", - "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -7126,7 +7419,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" } @@ -9389,6 +9681,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, @@ -9991,7 +10288,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", @@ -10036,8 +10332,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", @@ -10195,7 +10490,6 @@ }, "node_modules/diff-sequences": { "version": "26.6.2", - "dev": true, "license": "MIT", "engines": { "node": ">= 10.14.2" @@ -10236,6 +10530,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", @@ -10682,7 +10981,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", @@ -10701,8 +10999,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", @@ -12977,7 +13274,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" } @@ -13334,7 +13630,6 @@ }, "node_modules/has-bigints": { "version": "1.0.2", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -13912,7 +14207,6 @@ }, "node_modules/is-bigint": { "version": "1.0.4", - "dev": true, "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" @@ -13934,7 +14228,6 @@ }, "node_modules/is-boolean-object": { "version": "1.1.1", - "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.2" @@ -14022,7 +14315,6 @@ }, "node_modules/is-date-object": { "version": "1.0.5", - "dev": true, "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" @@ -14144,7 +14436,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" } @@ -14189,7 +14480,6 @@ }, "node_modules/is-number-object": { "version": "1.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -14246,7 +14536,6 @@ }, "node_modules/is-regex": { "version": "1.1.4", - "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -14263,7 +14552,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" } @@ -14292,7 +14580,6 @@ }, "node_modules/is-string": { "version": "1.0.7", - "dev": true, "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" @@ -14311,7 +14598,6 @@ }, "node_modules/is-symbol": { "version": "1.0.4", - "dev": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" @@ -14345,7 +14631,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" } @@ -14365,7 +14650,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" @@ -15900,7 +16184,6 @@ }, "node_modules/jest-diff": { "version": "26.6.2", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -15914,7 +16197,6 @@ }, "node_modules/jest-diff/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -15928,7 +16210,6 @@ }, "node_modules/jest-diff/node_modules/chalk": { "version": "4.1.1", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -15943,7 +16224,6 @@ }, "node_modules/jest-diff/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -15954,12 +16234,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" @@ -15967,7 +16245,6 @@ }, "node_modules/jest-diff/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -16525,7 +16802,6 @@ }, "node_modules/jest-get-type": { "version": "26.3.0", - "dev": true, "license": "MIT", "engines": { "node": ">= 10.14.2" @@ -21508,6 +21784,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", @@ -21906,7 +22190,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" } @@ -23071,7 +23354,6 @@ }, "node_modules/pretty-format": { "version": "26.6.2", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^26.6.2", @@ -23085,7 +23367,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", @@ -23100,7 +23381,6 @@ }, "node_modules/pretty-format/node_modules/@types/istanbul-reports": { "version": "3.0.1", - "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" @@ -23108,7 +23388,6 @@ }, "node_modules/pretty-format/node_modules/@types/yargs": { "version": "15.0.13", - "dev": true, "license": "MIT", "dependencies": { "@types/yargs-parser": "*" @@ -23116,7 +23395,6 @@ }, "node_modules/pretty-format/node_modules/ansi-regex": { "version": "5.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -23124,7 +23402,6 @@ }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -23138,7 +23415,6 @@ }, "node_modules/pretty-format/node_modules/chalk": { "version": "4.1.1", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -23153,7 +23429,6 @@ }, "node_modules/pretty-format/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -23164,12 +23439,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" @@ -23177,12 +23450,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" @@ -25200,7 +25471,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" }, @@ -26990,8 +27260,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.0", @@ -27995,7 +28264,6 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", - "dev": true, "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", @@ -28044,7 +28312,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", @@ -28343,6 +28610,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", @@ -32147,6 +32419,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, @@ -32176,6 +32628,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", @@ -32299,6 +32756,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": { @@ -32307,12 +32770,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": "*" } @@ -32329,7 +32790,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" @@ -32394,7 +32854,6 @@ }, "@types/react-dom": { "version": "17.0.9", - "devOptional": true, "requires": { "@types/react": "*" } @@ -32420,6 +32879,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" }, @@ -32433,6 +32913,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", @@ -32446,8 +32934,7 @@ } }, "@types/yargs-parser": { - "version": "20.2.0", - "dev": true + "version": "20.2.0" }, "@typescript-eslint/eslint-plugin": { "version": "7.0.0", @@ -33023,7 +33510,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" } @@ -34604,6 +35090,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 @@ -35030,7 +35521,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", @@ -35055,8 +35545,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==" } } }, @@ -35176,8 +35665,7 @@ "dev": true }, "diff-sequences": { - "version": "26.6.2", - "dev": true + "version": "26.6.2" }, "dir-glob": { "version": "3.0.1", @@ -35203,6 +35691,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", @@ -35534,7 +36027,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", @@ -35550,8 +36042,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==" } } }, @@ -37100,8 +37591,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", @@ -37346,8 +37836,7 @@ } }, "has-bigints": { - "version": "1.0.2", - "dev": true + "version": "1.0.2" }, "has-flag": { "version": "3.0.0" @@ -37720,7 +38209,6 @@ }, "is-bigint": { "version": "1.0.4", - "dev": true, "requires": { "has-bigints": "^1.0.1" } @@ -37734,7 +38222,6 @@ }, "is-boolean-object": { "version": "1.1.1", - "dev": true, "requires": { "call-bind": "^1.0.2" } @@ -37788,7 +38275,6 @@ }, "is-date-object": { "version": "1.0.5", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -37857,8 +38343,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", @@ -37892,8 +38377,7 @@ } }, "is-number-object": { - "version": "1.0.5", - "dev": true + "version": "1.0.5" }, "is-path-inside": { "version": "3.0.3", @@ -37921,7 +38405,6 @@ }, "is-regex": { "version": "1.1.4", - "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -37930,8 +38413,7 @@ "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", @@ -37947,7 +38429,6 @@ }, "is-string": { "version": "1.0.7", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -37958,7 +38439,6 @@ }, "is-symbol": { "version": "1.0.4", - "dev": true, "requires": { "has-symbols": "^1.0.2" } @@ -37977,8 +38457,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", @@ -37991,7 +38470,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" @@ -39388,7 +39866,6 @@ }, "jest-diff": { "version": "26.6.2", - "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^26.6.2", @@ -39398,14 +39875,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" @@ -39413,22 +39888,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" } @@ -39817,8 +40288,7 @@ } }, "jest-get-type": { - "version": "26.3.0", - "dev": true + "version": "26.3.0" }, "jest-haste-map": { "version": "24.9.0", @@ -42988,6 +43458,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", @@ -43244,8 +43719,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", @@ -43989,7 +44463,6 @@ }, "pretty-format": { "version": "26.6.2", - "dev": true, "requires": { "@jest/types": "^26.6.2", "ansi-regex": "^5.0.0", @@ -43999,7 +44472,6 @@ "dependencies": { "@jest/types": { "version": "26.6.2", - "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", @@ -44010,32 +44482,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" @@ -44043,26 +44510,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" } @@ -45429,7 +45891,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" } @@ -46642,8 +47103,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.0", @@ -47236,7 +47696,6 @@ }, "which-boxed-primitive": { "version": "1.0.2", - "dev": true, "requires": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -47277,7 +47736,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 1b8768b72..3526c1f29 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/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 e6e2fe903..295b52489 100644 --- a/src/containers/Transactions/test/Meta.test.tsx +++ b/src/containers/Transactions/test/Meta.test.tsx @@ -34,7 +34,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( @@ -42,7 +42,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( @@ -50,7 +50,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( @@ -58,11 +58,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( @@ -74,11 +74,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( @@ -86,7 +86,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( @@ -94,7 +94,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( @@ -102,7 +102,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( @@ -110,7 +110,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( @@ -118,7 +118,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( 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 164b06737..5120df5d6 100644 --- a/src/containers/shared/components/Amount.tsx +++ b/src/containers/shared/components/Amount.tsx @@ -25,8 +25,8 @@ export const Amount = ({ const localizedAmount = localizeNumber(amount, language, options) return ( - - + + {modifier && {modifier}} {localizedAmount} {' '} diff --git a/src/containers/shared/components/Currency.tsx b/src/containers/shared/components/Currency.tsx index 64727ca0a..3c89b6731 100644 --- a/src/containers/shared/components/Currency.tsx +++ b/src/containers/shared/components/Currency.tsx @@ -44,16 +44,20 @@ const Currency = (props: Props) => { display += shortenIssuer ? issuer.substring(0, 4) : issuer } - const content = - link && issuer ? ( - - {display} - - ) : ( - display - ) - - return {content} + return link && issuer ? ( + + {display} + + ) : ( + + {display} + + ) } 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 acbe14315..cbcd4f2d3 100644 --- a/src/containers/shared/components/test/Amount.test.tsx +++ b/src/containers/shared/components/test/Amount.test.tsx @@ -1,12 +1,13 @@ import { I18nextProvider } from 'react-i18next' import { BrowserRouter } from 'react-router-dom' -import { mount } from 'enzyme' +import { cleanup, render, screen } from '@testing-library/react' import { Amount } from '../Amount' import i18n from '../../../../i18n/testConfig' describe('Amount', () => { - const createWrapper = (component: JSX.Element) => - mount( + afterEach(cleanup) + const renderComponent = (component: JSX.Element) => + render( {component} , @@ -19,12 +20,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', () => { @@ -34,25 +36,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 ', () => { @@ -62,12 +68,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 ', () => { @@ -76,12 +83,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', () => { @@ -90,31 +98,28 @@ 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() }) }) diff --git a/src/containers/shared/components/test/Currency.test.tsx b/src/containers/shared/components/test/Currency.test.tsx index e3d218090..0686cca19 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') }) }) 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"