From e9645470516f39358fe52b880a1dee4203c67d8c Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 22 Feb 2024 16:46:09 -0500 Subject: [PATCH 1/6] move to clean RTL branch --- package-lock.json | 712 ++++++++++++++---- package.json | 4 + .../Transactions/test/Meta.test.tsx | 24 +- src/containers/shared/components/Account.tsx | 9 +- .../test/DepositPreauthDescription.test.tsx | 4 +- .../test/EscrowCancelDescription.test.tsx | 2 +- .../test/EscrowCreateDescription.test.tsx | 2 +- .../test/EscrowFinishDescription.test.tsx | 2 +- .../test/OfferCreateDescription.test.tsx | 4 +- .../test/TrustSetDescription.test.tsx | 2 +- .../shared/components/test/Account.test.tsx | 121 ++- src/setupTests.ts | 1 + tsconfig.json | 2 +- 13 files changed, 658 insertions(+), 231 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90867dc3a..d06aa6145 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": "^6.18.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", @@ -5888,6 +5897,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, @@ -5921,6 +6179,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", @@ -6049,6 +6312,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", @@ -6059,12 +6328,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": "*" @@ -6083,7 +6350,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" @@ -6117,7 +6383,6 @@ "version": "18.18.8", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.8.tgz", "integrity": "sha512-OLGBaaK5V3VRBS1bAkMVP2/W9B+H8meUfl866OrMNQqt7wDgdpWPp5o6gmIc9pB+lIQHSq4ZL8ypeH1vPxcPaQ==", - "devOptional": true, "dependencies": { "undici-types": "~5.26.4" } @@ -6153,7 +6418,6 @@ }, "node_modules/@types/react-dom": { "version": "17.0.9", - "devOptional": true, "license": "MIT", "dependencies": { "@types/react": "*" @@ -6170,6 +6434,27 @@ "redux": "^4.0.0" } }, + "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" @@ -6185,6 +6470,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", @@ -6200,7 +6493,6 @@ }, "node_modules/@types/yargs-parser": { "version": "20.2.0", - "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -7104,7 +7396,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" } @@ -7137,7 +7428,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "is-array-buffer": "^3.0.1" @@ -9331,6 +9621,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, @@ -9882,7 +10177,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", @@ -9927,8 +10221,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", @@ -10310,7 +10603,6 @@ }, "node_modules/diff-sequences": { "version": "26.6.2", - "dev": true, "license": "MIT", "engines": { "node": ">= 10.14.2" @@ -10351,6 +10643,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": "3.4.0", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz", @@ -10776,7 +11073,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", @@ -10795,8 +11091,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.15", @@ -13048,7 +13343,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" } @@ -13386,7 +13680,6 @@ }, "node_modules/has-bigints": { "version": "1.0.2", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -13850,7 +14143,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", - "dev": true, "dependencies": { "get-intrinsic": "^1.2.0", "has": "^1.0.3", @@ -13929,7 +14221,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.0", @@ -13960,7 +14251,6 @@ }, "node_modules/is-bigint": { "version": "1.0.4", - "dev": true, "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" @@ -13982,7 +14272,6 @@ }, "node_modules/is-boolean-object": { "version": "1.1.1", - "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.2" @@ -14055,7 +14344,6 @@ }, "node_modules/is-date-object": { "version": "1.0.5", - "dev": true, "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" @@ -14210,7 +14498,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" } @@ -14254,7 +14541,6 @@ }, "node_modules/is-number-object": { "version": "1.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -14311,7 +14597,6 @@ }, "node_modules/is-regex": { "version": "1.1.4", - "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -14328,14 +14613,12 @@ "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" } }, "node_modules/is-shared-array-buffer": { "version": "1.0.2", - "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.2" @@ -14353,7 +14636,6 @@ }, "node_modules/is-string": { "version": "1.0.7", - "dev": true, "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" @@ -14372,7 +14654,6 @@ }, "node_modules/is-symbol": { "version": "1.0.4", - "dev": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" @@ -14409,7 +14690,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" } @@ -14429,7 +14709,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" @@ -15964,7 +16243,6 @@ }, "node_modules/jest-diff": { "version": "26.6.2", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -15978,7 +16256,6 @@ }, "node_modules/jest-diff/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -15992,7 +16269,6 @@ }, "node_modules/jest-diff/node_modules/chalk": { "version": "4.1.1", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -16007,7 +16283,6 @@ }, "node_modules/jest-diff/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -16018,12 +16293,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" @@ -16031,7 +16304,6 @@ }, "node_modules/jest-diff/node_modules/supports-color": { "version": "7.2.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -16589,7 +16861,6 @@ }, "node_modules/jest-get-type": { "version": "26.3.0", - "dev": true, "license": "MIT", "engines": { "node": ">= 10.14.2" @@ -21574,6 +21845,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", @@ -21972,7 +22251,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" } @@ -23123,7 +23401,6 @@ }, "node_modules/pretty-format": { "version": "26.6.2", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^26.6.2", @@ -23137,7 +23414,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", @@ -23152,7 +23428,6 @@ }, "node_modules/pretty-format/node_modules/@types/istanbul-reports": { "version": "3.0.1", - "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" @@ -23160,7 +23435,6 @@ }, "node_modules/pretty-format/node_modules/@types/yargs": { "version": "15.0.13", - "dev": true, "license": "MIT", "dependencies": { "@types/yargs-parser": "*" @@ -23168,7 +23442,6 @@ }, "node_modules/pretty-format/node_modules/ansi-regex": { "version": "5.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -23176,7 +23449,6 @@ }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -23190,7 +23462,6 @@ }, "node_modules/pretty-format/node_modules/chalk": { "version": "4.1.1", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -23205,7 +23476,6 @@ }, "node_modules/pretty-format/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -23216,12 +23486,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" @@ -23229,12 +23497,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" @@ -23896,7 +24162,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -25386,7 +25651,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" }, @@ -27161,8 +27425,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", @@ -28174,7 +28437,6 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", - "dev": true, "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", @@ -28223,7 +28485,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", @@ -28522,6 +28783,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", @@ -32330,6 +32596,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, @@ -32359,6 +32805,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", @@ -32482,6 +32933,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": { @@ -32490,12 +32947,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": "*" } @@ -32512,7 +32967,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" @@ -32546,7 +33000,6 @@ "version": "18.18.8", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.8.tgz", "integrity": "sha512-OLGBaaK5V3VRBS1bAkMVP2/W9B+H8meUfl866OrMNQqt7wDgdpWPp5o6gmIc9pB+lIQHSq4ZL8ypeH1vPxcPaQ==", - "devOptional": true, "requires": { "undici-types": "~5.26.4" } @@ -32577,7 +33030,6 @@ }, "@types/react-dom": { "version": "17.0.9", - "devOptional": true, "requires": { "@types/react": "*" } @@ -32592,6 +33044,27 @@ "redux": "^4.0.0" } }, + "@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" }, @@ -32605,6 +33078,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", @@ -32618,8 +33099,7 @@ } }, "@types/yargs-parser": { - "version": "20.2.0", - "dev": true + "version": "20.2.0" }, "@typescript-eslint/eslint-plugin": { "version": "6.18.0", @@ -33189,7 +33669,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" } @@ -33210,7 +33689,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dev": true, "requires": { "call-bind": "^1.0.2", "is-array-buffer": "^3.0.1" @@ -34743,6 +35221,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 @@ -35136,7 +35619,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", @@ -35161,8 +35643,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==" } } }, @@ -35426,8 +35907,7 @@ "dev": true }, "diff-sequences": { - "version": "26.6.2", - "dev": true + "version": "26.6.2" }, "dir-glob": { "version": "3.0.1", @@ -35453,6 +35933,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": "3.4.0", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz", @@ -35769,7 +36254,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", @@ -35785,8 +36269,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==" } } }, @@ -37317,8 +37800,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", @@ -37552,8 +38034,7 @@ } }, "has-bigints": { - "version": "1.0.2", - "dev": true + "version": "1.0.2" }, "has-flag": { "version": "3.0.0" @@ -37851,7 +38332,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", - "dev": true, "requires": { "get-intrinsic": "^1.2.0", "has": "^1.0.3", @@ -37902,7 +38382,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", - "dev": true, "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.0", @@ -37923,7 +38402,6 @@ }, "is-bigint": { "version": "1.0.4", - "dev": true, "requires": { "has-bigints": "^1.0.1" } @@ -37937,7 +38415,6 @@ }, "is-boolean-object": { "version": "1.1.1", - "dev": true, "requires": { "call-bind": "^1.0.2" } @@ -37982,7 +38459,6 @@ }, "is-date-object": { "version": "1.0.5", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -38068,8 +38544,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", @@ -38101,8 +38576,7 @@ } }, "is-number-object": { - "version": "1.0.5", - "dev": true + "version": "1.0.5" }, "is-path-inside": { "version": "3.0.3", @@ -38130,7 +38604,6 @@ }, "is-regex": { "version": "1.1.4", - "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -38139,12 +38612,10 @@ "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.2", - "dev": true, "requires": { "call-bind": "^1.0.2" } @@ -38154,7 +38625,6 @@ }, "is-string": { "version": "1.0.7", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -38165,7 +38635,6 @@ }, "is-symbol": { "version": "1.0.4", - "dev": true, "requires": { "has-symbols": "^1.0.2" } @@ -38186,8 +38655,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", @@ -38200,7 +38668,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" @@ -39597,7 +40064,6 @@ }, "jest-diff": { "version": "26.6.2", - "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^26.6.2", @@ -39607,14 +40073,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" @@ -39622,22 +40086,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" } @@ -40026,8 +40486,7 @@ } }, "jest-get-type": { - "version": "26.3.0", - "dev": true + "version": "26.3.0" }, "jest-haste-map": { "version": "24.9.0", @@ -43194,6 +43653,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", @@ -43450,8 +43914,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", @@ -44186,7 +44649,6 @@ }, "pretty-format": { "version": "26.6.2", - "dev": true, "requires": { "@jest/types": "^26.6.2", "ansi-regex": "^5.0.0", @@ -44196,7 +44658,6 @@ "dependencies": { "@jest/types": { "version": "26.6.2", - "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", @@ -44207,32 +44668,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" @@ -44240,26 +44696,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" } @@ -44706,7 +45157,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", - "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -45719,7 +46169,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" } @@ -46918,8 +47367,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", @@ -47516,7 +47964,6 @@ }, "which-boxed-primitive": { "version": "1.0.2", - "dev": true, "requires": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -47557,7 +48004,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 88bbc67fb..4766c9fd8 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": "^6.18.0", "@typescript-eslint/parser": "^6.21.0", "babel-jest": "^29.7.0", 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
  • ', + '
  • owned_account_root
  • ', ) 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
  • ', + '
  • owned_account_root
  • ', ) 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
  • ', + '
  • owned_account_root
  • ', ) 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 bywith sequence # 1181517
  • ', + '
  • It modified a XRP/CNYowned bywith 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. decreased byCN¥224.7141103fromCN¥2,100.12079671toCN¥1,875.40668641
  • ', + '
  • TakerGets CNY. decreased byCN¥224.7141103fromCN¥2,100.12079671toCN¥1,875.40668641
  • ', ) expect(w.find('li').at(11).html()).toBe( - '
  • It modified a XRP/CNYowned bywith sequence # 5804
  • ', + '
  • It modified a XRP/CNYowned bywith 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. decreased byCN¥225.45293634fromCN¥12,589.58241408toCN¥12,364.12947774
  • ', + '
  • TakerPays CNY. 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 betweenand
  • ', + '
  • It modified a CNYripplestate node betweenand
  • ', ) 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 betweenand
  • ', + '
  • It modified a CNYripplestate node betweenand
  • ', ) 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 betweenand
  • ', + '
  • It modified a CNYripplestate node betweenand
  • ', ) 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 betweenand
  • ', + '
  • It modified a CNYripplestate node betweenand
  • ', ) 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/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/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..237309a0c 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( + 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() + createWrapper() + const link = screen.getByTestId('account') + expect(link).toHaveClass('account') + expect(link).toHaveTextContent(ACCOUNT) + expect(link).toHaveAttribute('href', `/accounts/${ACCOUNT}`) + expect(link).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() + createWrapper() + const link = screen.getByTestId('account') + expect(link).toHaveTextContent(ACCOUNT) + expect(link).not.toHaveAttribute('href') + expect(link).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() + createWrapper() + const link = screen.getByTestId('account') + expect(link).toHaveClass('account') + expect(link).toHaveTextContent(ACCOUNT) + expect(link).toHaveAttribute('href', `/accounts/${ACCOUNT}`) + expect(link).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() + createWrapper() + const link = screen.getByTestId('account') + expect(link).toHaveClass('account') + expect(link).toHaveTextContent(ACCOUNT) + expect(link).not.toHaveAttribute('href') + expect(link).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() + createWrapper() + const link = screen.getByTestId('account') + expect(link).toHaveClass('account') + expect(link).toHaveTextContent(ACCOUNT) + expect(link).toHaveAttribute('href', `/accounts/${ACCOUNT}`) + expect(link).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() + createWrapper() + const link = screen.getByTestId('account') + expect(link).toHaveTextContent(ACCOUNT) + expect(link).not.toHaveAttribute('href') + expect(link).toHaveAttribute('title', ACCOUNT) + expect(screen.queryByTestId('dt')).toHaveTextContent(':123') }) }) 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" From dbf3acc43690e3dbc3129e267c0dd6df95f40cf3 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 18 Apr 2024 17:00:17 -0400 Subject: [PATCH 2/6] update PR template --- .github/pull_request_template.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 From d9a364ff59e5882893c9defe9bced6105dccee50 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 30 Apr 2024 13:19:53 -0400 Subject: [PATCH 3/6] add Currency tests --- package-lock.json | 20 +++--- src/containers/shared/components/Currency.tsx | 24 ++++--- .../shared/components/test/Account.test.tsx | 70 +++++++++---------- .../shared/components/test/Currency.test.tsx | 65 ++++++++++------- 4 files changed, 97 insertions(+), 82 deletions(-) diff --git a/package-lock.json b/package-lock.json index 41762e6ad..d4c9a83fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6298,7 +6298,6 @@ "version": "18.19.21", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.21.tgz", "integrity": "sha512-2Q2NeB6BmiTFQi4DHBzncSoq/cJMLDdhPaAoJFnFCyD9a8VPZRf7a1GAwp1Edb7ROaZc5Jz/tnZyL6EsWMRaqw==", - "devOptional": true, "dependencies": { "undici-types": "~5.26.4" } @@ -6350,6 +6349,15 @@ "redux": "^4.0.0" } }, + "node_modules/@types/react-redux/node_modules/redux": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", + "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", + "dev": true, + "dependencies": { + "@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", @@ -6371,15 +6379,6 @@ "@types/react-router": "*" } }, - "node_modules/@types/react-redux/node_modules/redux": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", - "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.9.2" - } - }, "node_modules/@types/scheduler": { "version": "0.16.2", "license": "MIT" @@ -32411,7 +32410,6 @@ "version": "18.19.21", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.21.tgz", "integrity": "sha512-2Q2NeB6BmiTFQi4DHBzncSoq/cJMLDdhPaAoJFnFCyD9a8VPZRf7a1GAwp1Edb7ROaZc5Jz/tnZyL6EsWMRaqw==", - "devOptional": true, "requires": { "undici-types": "~5.26.4" } 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/test/Account.test.tsx b/src/containers/shared/components/test/Account.test.tsx index 237309a0c..958463089 100644 --- a/src/containers/shared/components/test/Account.test.tsx +++ b/src/containers/shared/components/test/Account.test.tsx @@ -4,7 +4,7 @@ import { cleanup, render, screen } from '@testing-library/react' import i18n from '../../../../i18n/testConfig' import { Account } from '../Account' -const createWrapper = (component: JSX.Element) => +const renderComponent = (component: JSX.Element) => render( {component} @@ -17,59 +17,59 @@ const ACCOUNT_PLUS_DT = `${ACCOUNT}:381702` describe('Account', () => { afterEach(cleanup) it('should render with a link', () => { - createWrapper() - const link = screen.getByTestId('account') - expect(link).toHaveClass('account') - expect(link).toHaveTextContent(ACCOUNT) - expect(link).toHaveAttribute('href', `/accounts/${ACCOUNT}`) - expect(link).toHaveAttribute('title', ACCOUNT) + 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', () => { - createWrapper() - const link = screen.getByTestId('account') - expect(link).toHaveTextContent(ACCOUNT) - expect(link).not.toHaveAttribute('href') - expect(link).toHaveAttribute('title', ACCOUNT) + 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', () => { - createWrapper() - const link = screen.getByTestId('account') - expect(link).toHaveClass('account') - expect(link).toHaveTextContent(ACCOUNT) - expect(link).toHaveAttribute('href', `/accounts/${ACCOUNT}`) - expect(link).toHaveAttribute('title', ACCOUNT) + 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', () => { - createWrapper() - const link = screen.getByTestId('account') - expect(link).toHaveClass('account') - expect(link).toHaveTextContent(ACCOUNT) - expect(link).not.toHaveAttribute('href') - expect(link).toHaveAttribute('title', ACCOUNT) + 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', () => { - createWrapper() - const link = screen.getByTestId('account') - expect(link).toHaveClass('account') - expect(link).toHaveTextContent(ACCOUNT) - expect(link).toHaveAttribute('href', `/accounts/${ACCOUNT}`) - expect(link).toHaveAttribute('title', ACCOUNT) + 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', () => { - createWrapper() - const link = screen.getByTestId('account') - expect(link).toHaveTextContent(ACCOUNT) - expect(link).not.toHaveAttribute('href') - expect(link).toHaveAttribute('title', ACCOUNT) + 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/Currency.test.tsx b/src/containers/shared/components/test/Currency.test.tsx index e3d218090..2058b3c6b 100644 --- a/src/containers/shared/components/test/Currency.test.tsx +++ b/src/containers/shared/components/test/Currency.test.tsx @@ -1,38 +1,44 @@ import { BrowserRouter } from 'react-router-dom' -import { mount } from 'enzyme' +import { cleanup, render, screen } from '@testing-library/react' import Currency from '../Currency' describe('Currency', () => { 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') + cleanup() }) 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') + cleanup() }) 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') + cleanup() }) 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') + cleanup() }) 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() + cleanup() }) 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') + cleanup() }) }) From 9c220e6a5f40ed7e6f411503cace674b07d4b417 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 30 Apr 2024 13:21:27 -0400 Subject: [PATCH 4/6] clean up --- src/containers/shared/components/test/Currency.test.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/containers/shared/components/test/Currency.test.tsx b/src/containers/shared/components/test/Currency.test.tsx index 2058b3c6b..0686cca19 100644 --- a/src/containers/shared/components/test/Currency.test.tsx +++ b/src/containers/shared/components/test/Currency.test.tsx @@ -3,12 +3,12 @@ import { cleanup, render, screen } from '@testing-library/react' import Currency from '../Currency' describe('Currency', () => { + afterEach(cleanup) it('handles currency codes that are 3 characters ', () => { render() const element = screen.getByTestId('currency') expect(element).toHaveClass('currency') expect(element).toHaveTextContent('BTC') - cleanup() }) it('handles currency codes that are 4 characters ', () => { @@ -16,7 +16,6 @@ describe('Currency', () => { const element = screen.getByTestId('currency') expect(element).toHaveClass('currency') expect(element).toHaveTextContent('WOOT') - cleanup() }) it('handles currency codes that are 4 characters and include issuer ', () => { @@ -26,7 +25,6 @@ describe('Currency', () => { const element = screen.getByTestId('currency') expect(element).toHaveClass('currency') expect(element).toHaveTextContent('USD.davi') - cleanup() }) it('handles currency codes that are 40 characters ', () => { @@ -34,7 +32,6 @@ describe('Currency', () => { const element = screen.getByTestId('currency') expect(element).toHaveClass('currency') expect(element).toHaveTextContent('XMETA') - cleanup() }) it('handles currency codes that are 40 characters and issuer ', () => { @@ -66,7 +63,6 @@ describe('Currency', () => { 'href', '/token/USD.rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq', ) - cleanup() }) it('displays the XRP symbol when rendering XRP', () => { @@ -74,6 +70,5 @@ describe('Currency', () => { const element = screen.getByTestId('currency') expect(element).toHaveClass('currency') expect(element).toHaveTextContent('\uE900 XRP') - cleanup() }) }) From 1a8c912f375d10c104345a1b1d9d18aed836edac Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 30 Apr 2024 13:34:33 -0400 Subject: [PATCH 5/6] fix Amount tests (by conversion) --- src/containers/shared/components/Amount.tsx | 4 +- ....jsx => NFTokenAcceptOfferSimple.test.tsx} | 0 ...le.test.jsx => NFTokenBurnSimple.test.tsx} | 0 ....jsx => NFTokenCancelOfferSimple.test.tsx} | 0 ....jsx => NFTokenCreateOfferSimple.test.tsx} | 0 ...le.test.jsx => NFTokenMintSimple.test.tsx} | 0 .../shared/components/test/Amount.test.tsx | 81 ++++++++++--------- 7 files changed, 45 insertions(+), 40 deletions(-) rename src/containers/shared/components/Transaction/NFTokenAcceptOffer/test/{NFTokenAcceptOfferSimple.test.jsx => NFTokenAcceptOfferSimple.test.tsx} (100%) rename src/containers/shared/components/Transaction/NFTokenBurn/test/{NFTokenBurnSimple.test.jsx => NFTokenBurnSimple.test.tsx} (100%) rename src/containers/shared/components/Transaction/NFTokenCancelOffer/test/{NFTokenCancelOfferSimple.test.jsx => NFTokenCancelOfferSimple.test.tsx} (100%) rename src/containers/shared/components/Transaction/NFTokenCreateOffer/test/{NFTokenCreateOfferSimple.test.jsx => NFTokenCreateOfferSimple.test.tsx} (100%) rename src/containers/shared/components/Transaction/NFTokenMint/test/{NFTokenMintSimple.test.jsx => NFTokenMintSimple.test.tsx} (100%) 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/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 100% rename from src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.jsx rename to src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx 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() }) }) From 0bc0c7668a148b70646b79dc9513b9c6bf1f0e6e Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 30 Apr 2024 13:36:54 -0400 Subject: [PATCH 6/6] fix ts issue --- .../Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx b/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx index 0ce68de1c..1da139efa 100644 --- a/src/containers/shared/components/Transaction/NFTokenMint/test/NFTokenMintSimple.test.tsx +++ 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() })