From cbb8d68c40ba5409a2f574be5a96753703c60c9a Mon Sep 17 00:00:00 2001 From: v1rtl Date: Mon, 9 Dec 2024 15:00:38 +0200 Subject: [PATCH 1/2] bump msw --- package.json | 2 +- pnpm-lock.yaml | 349 +++++++++--------- .../useSubscribeToEarnifi.test.ts | 10 +- .../SyncDroppedTransaction.test.tsx | 27 +- src/utils/date.test.ts | 18 +- src/utils/query/reactQuery.test.tsx | 14 +- .../categoriseProfileTextRecords.test.ts | 37 +- src/utils/utils.test.ts | 2 +- .../isVerificationProtocol.test.ts | 5 +- 9 files changed, 223 insertions(+), 241 deletions(-) diff --git a/package.json b/package.json index 924500452..53ee8d679 100644 --- a/package.json +++ b/package.json @@ -157,7 +157,7 @@ "jsdom": "^24.1.0", "knip": "^5.27.2", "lokijs": "^1.5.12", - "msw": "^1.2.3", + "msw": "^2.6.8", "multiformats": "^12.0.1", "next-compose-plugins": "^2.2.1", "next-dev-https": "^0.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5bc20d3f..c8afbce99 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -414,8 +414,8 @@ importers: specifier: ^1.5.12 version: 1.5.12 msw: - specifier: ^1.2.3 - version: 1.3.3(encoding@0.1.13)(typescript@5.4.5) + specifier: ^2.6.8 + version: 2.6.8(@types/node@18.19.33)(typescript@5.4.5) multiformats: specifier: ^12.0.1 version: 12.1.3 @@ -1516,6 +1516,15 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + '@bundled-es-modules/cookie@2.0.1': + resolution: {integrity: sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw==} + + '@bundled-es-modules/statuses@1.0.1': + resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} + + '@bundled-es-modules/tough-cookie@0.1.6': + resolution: {integrity: sha512-dvMHbL464C0zI+Yqxbz6kZ5TOEp7GLW+pry/RWndAR8MJQAXZ2rPmIs8tziTZjeIyhSNZgZbCePtfSbdWqStJw==} + '@cloudflare/kv-asset-handler@0.3.2': resolution: {integrity: sha512-EeEjMobfuJrwoctj7FA1y1KEbM0+Q1xSjobIEyie9k4haVEBB7vkDvsasw1pM3rO39mL2akxIAzLMUAtrMHZhA==} engines: {node: '>=16.13'} @@ -2107,6 +2116,26 @@ packages: '@vue/compiler-sfc': optional: true + '@inquirer/confirm@5.1.0': + resolution: {integrity: sha512-osaBbIMEqVFjTX5exoqPXs6PilWQdjaLhGtMDXMXg/yxkHXNq43GlxGyTA35lK2HpzUgDN+Cjh/2AmqCN0QJpw==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + + '@inquirer/core@10.1.1': + resolution: {integrity: sha512-rmZVXy9iZvO3ZStEe/ayuuwIJ23LSF13aPMlLMTQARX6lGUBDHGV8UB5i9MRrfy0+mZwt5/9bdy8llszSD3NQA==} + engines: {node: '>=18'} + + '@inquirer/figures@1.0.8': + resolution: {integrity: sha512-tKd+jsmhq21AP1LhexC0pPwsCxEhGgAkg28byjJAd+xhmIs8LUX8JbUc3vBf3PhLxWiB5EvyBE5X7JSPAqMAqg==} + engines: {node: '>=18'} + + '@inquirer/type@3.0.1': + resolution: {integrity: sha512-+ksJMIy92sOAiAccGpcKZUc3bYO07cADnscIxHBknEm3uNts3movSmBofc1908BNy5edKscxYeAdaX1NXkHS6A==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -2318,13 +2347,9 @@ packages: resolution: {integrity: sha512-z10PF9JV6SbjFq+/rYabM+8CVlMokgl8RFGvieSGNTmrkQanfHn+15XBrhG3BgUfvmTeSeyShfOHpG0i9zEdcg==} deprecated: Motion One for Vue is deprecated. Use Oku Motion instead https://oku-ui.com/motion - '@mswjs/cookies@0.2.2': - resolution: {integrity: sha512-mlN83YSrcFgk7Dm1Mys40DLssI1KdJji2CMKN8eOlBqsTADYzj2+jWzsANsUTFbxDMWPD5e9bfA1RGqBpS3O1g==} - engines: {node: '>=14'} - - '@mswjs/interceptors@0.17.10': - resolution: {integrity: sha512-N8x7eSLGcmUFNWZRxT1vsHvypzIRgQYdG0rJey/rZCy6zT/30qDt8Joj7FxzGNLSwXbeZqJOMqDurp7ra4hgbw==} - engines: {node: '>=14'} + '@mswjs/interceptors@0.37.3': + resolution: {integrity: sha512-USvgCL/uOGFtVa6SVyRrC8kIAedzRohxIXN5LISlg5C5vLZCn7dgMFVSNhSF9cuBEFrm/O2spDWEZeMnw4ZXYg==} + engines: {node: '>=18'} '@multiformats/sha3@2.0.17': resolution: {integrity: sha512-7ik6pk178qLO2cpNucgf48UnAOBMkq/2H92DP4SprZOJqM9zqbVaKS7XyYW6UvhRsDJ3wi921fYv1ihTtQHLtA==} @@ -2554,8 +2579,14 @@ packages: resolution: {integrity: sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg==} engines: {node: '>= 12'} - '@open-draft/until@1.0.3': - resolution: {integrity: sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==} + '@open-draft/deferred-promise@2.2.0': + resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} + + '@open-draft/logger@0.3.0': + resolution: {integrity: sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==} + + '@open-draft/until@2.1.0': + resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} '@openzeppelin/contract-loader@0.6.3': resolution: {integrity: sha512-cOFIjBjwbGgZhDZsitNgJl0Ye1rd5yu/Yx5LMgeq3u0ZYzldm4uObzHDFq4gjDdoypvyORjjJa3BlFA7eAnVIg==} @@ -3553,8 +3584,8 @@ packages: '@types/cacheable-request@6.0.3': resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} - '@types/cookie@0.4.1': - resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} + '@types/cookie@0.6.0': + resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} @@ -3592,9 +3623,6 @@ packages: '@types/js-cookie@2.2.7': resolution: {integrity: sha512-aLkWa0C0vO5b4Sr798E26QgOkss68Un0bLjs7u9qxzPT5CG+8DuNTffWES58YzJs3hrVAOs1wonycqEBqNJubA==} - '@types/js-levenshtein@1.1.3': - resolution: {integrity: sha512-jd+Q+sD20Qfu9e2aEXogiO3vpOC1PYJOUdyN9gvs4Qrvkg4wF43L5OhqrPeokdv8TL0/mXoYfpkcoGZMNN2pkQ==} - '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -3673,15 +3701,18 @@ packages: '@types/semver@7.5.8': resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@types/set-cookie-parser@2.4.7': - resolution: {integrity: sha512-+ge/loa0oTozxip6zmhRIk8Z/boU51wl9Q6QdLZcokIGMzY5lFXYy/x7Htj2HTC6/KZP1hUbZ1ekx8DYXICvWg==} - '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@types/statuses@2.0.5': + resolution: {integrity: sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==} + '@types/styled-components@5.1.23': resolution: {integrity: sha512-zt8oQGU6XB4LH1Xpq169YnAVmt22+swzHJvyKMyTZu/z8+afvgKjjg0s79aAodgNSf36ZOEG6DyVAW/JhLH2Nw==} + '@types/tough-cookie@4.0.5': + resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} + '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} @@ -4005,10 +4036,6 @@ packages: '@webassemblyjs/wast-printer@1.12.1': resolution: {integrity: sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==} - '@xmldom/xmldom@0.8.10': - resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} - engines: {node: '>=10.0.0'} - '@xobotyi/scrollbar-width@1.9.5': resolution: {integrity: sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==} @@ -4018,9 +4045,6 @@ packages: '@xtuc/long@4.2.2': resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} - '@zxing/text-encoding@0.9.0': - resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} - abbrev@1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} @@ -4574,9 +4598,6 @@ packages: change-case@3.0.2: resolution: {integrity: sha512-Mww+SLF6MZ0U6kdg11algyKd5BARbyM4TbFBepwowYSR5ClfQGCGtxNXgykpN0uF/bstWeaGDT4JWaDh8zWAHA==} - chardet@0.7.0: - resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - check-error@1.0.3: resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} @@ -4652,9 +4673,9 @@ packages: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} - cli-width@3.0.0: - resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==} - engines: {node: '>= 10'} + cli-width@4.1.0: + resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} + engines: {node: '>= 12'} client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} @@ -4822,6 +4843,10 @@ packages: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} engines: {node: '>= 0.6'} + cookie@0.7.2: + resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} + engines: {node: '>= 0.6'} + copy-to-clipboard@3.3.3: resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==} @@ -5659,10 +5684,6 @@ packages: resolution: {integrity: sha512-an2S5quJMiy5bnZKEf6AkfH/7r8CzHvhchU40gxN+OM6HPhe7Z9T1FUychcf2M9PpPOO0Hf7BAEfJkw2TDIBDw==} engines: {node: '>=12.0.0'} - external-editor@3.1.0: - resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} - engines: {node: '>=4'} - extract-files@9.0.0: resolution: {integrity: sha512-CvdFfHkC95B4bBBk36hcEmvdR2awOdhhVUYH6S/zrVj3477zven/fJMYg7121h4T1xHZC+tetUpubpAhxwI7hQ==} engines: {node: ^10.17.0 || ^12.0.0 || >= 13.7.0} @@ -5736,10 +5757,6 @@ packages: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} - figures@3.2.0: - resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} - engines: {node: '>=8'} - file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -6114,8 +6131,8 @@ packages: header-case@1.0.1: resolution: {integrity: sha512-i0q9mkOeSuhXw6bGgiQCCBgY/jlZuV/7dZXyZ9c6LcBrqwvT8eT719E9uxE5LiZftdl+z81Ugbg/VvXV4OJOeQ==} - headers-polyfill@3.2.5: - resolution: {integrity: sha512-tUCGvt191vNSQgttSyJoibR+VO+I6+iCHIUdhzEMJKE+EAL8BwCN7fUOZlY4ofOelNHsK+gEjxB/B+9N3EWtdA==} + headers-polyfill@4.0.3: + resolution: {integrity: sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==} hermes-estree@0.19.1: resolution: {integrity: sha512-daLGV3Q2MKk8w4evNMKwS8zBE/rcpA800nu1Q5kM08IKijoSnPe9Uo1iIxzPKRkn95IxxsgBMPeYHt3VG4ej2g==} @@ -6317,10 +6334,6 @@ packages: inline-style-prefixer@7.0.0: resolution: {integrity: sha512-I7GEdScunP1dQ6IM2mQWh6v0mOYdYmH3Bp31UecKdrcUgcURTcctSe1IECdUznSHKSmsHtjrT3CwCPI1pyxfUQ==} - inquirer@8.2.6: - resolution: {integrity: sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==} - engines: {node: '>=12.0.0'} - intl-segmenter-polyfill@0.4.4: resolution: {integrity: sha512-dIOcmvH+Q1WYGkjMqxPfaCgHEwOegH5UPcd/LLeaeY8aguHadC46MzGb40q8C1LrsuyJxJGKeKqoVtIh9ADRXQ==} @@ -6578,10 +6591,6 @@ packages: js-cookie@2.2.1: resolution: {integrity: sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==} - js-levenshtein@1.1.6: - resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} - engines: {node: '>=0.10.0'} - js-sha3@0.5.5: resolution: {integrity: sha512-yLLwn44IVeunwjpDVTDZmQeVbB0h+dZpY2eO68B/Zik8hu6dH+rKeLxwua79GGIvW6xr8NBAcrtiUbYrTjEFTA==} @@ -7229,12 +7238,12 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - msw@1.3.3: - resolution: {integrity: sha512-CiPyRFiYJCXYyH/vwxT7m+sa4VZHuUH6cGwRBj0kaTjBGpsk4EnL47YzhoA859htVCF2vzqZuOsomIUlFqg9GQ==} - engines: {node: '>=14'} + msw@2.6.8: + resolution: {integrity: sha512-nxXxnH6WALZ9a7rsQp4HU2AaD4iGAiouMmE/MY4al7pXTibgA6OZOuKhmN2WBIM6w9qMKwRtX8p2iOb45B2M/Q==} + engines: {node: '>=18'} hasBin: true peerDependencies: - typescript: '>= 4.4.x' + typescript: '>= 4.8.x' peerDependenciesMeta: typescript: optional: true @@ -7272,8 +7281,9 @@ packages: resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} hasBin: true - mute-stream@0.0.8: - resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} + mute-stream@2.0.0: + resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} + engines: {node: ^18.17.0 || >=20.5.0} nan@2.19.0: resolution: {integrity: sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==} @@ -7563,8 +7573,8 @@ packages: outdent@0.8.0: resolution: {integrity: sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==} - outvariant@1.4.2: - resolution: {integrity: sha512-Ou3dJ6bA/UJ5GVHxah4LnqDwZRwAmWxrG3wtrHrbGnP4RnLCtA64A4F+ae7Y8ww660JaddSoArUR5HjipWSHAQ==} + outvariant@1.4.3: + resolution: {integrity: sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==} p-cancelable@2.1.1: resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} @@ -7696,6 +7706,9 @@ packages: path-to-regexp@6.2.2: resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} + path-to-regexp@6.3.0: + resolution: {integrity: sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==} + path-type@1.1.0: resolution: {integrity: sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==} engines: {node: '>=0.10.0'} @@ -8357,10 +8370,6 @@ packages: rtl-css-js@1.16.1: resolution: {integrity: sha512-lRQgou1mu19e+Ya0LsTvKrVJ5TYUbqCVPAiImX3UfLTenarvPUl1QFdvu5Z3PYmHT9RCcwIfbjRQBntExyj3Zg==} - run-async@2.4.1: - resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} - engines: {node: '>=0.12.0'} - run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -8460,9 +8469,6 @@ packages: set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - set-cookie-parser@2.6.0: - resolution: {integrity: sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==} - set-harmonic-interval@1.0.1: resolution: {integrity: sha512-AhICkFV84tBP1aWqPwLZqFvAwqEoVA9kxNMniGEUvzOlm4vLmOFLiTT3UZ6bziJTy4bOVpzWGTfSCbmaayGx8g==} engines: {node: '>=6.9'} @@ -8695,11 +8701,8 @@ packages: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} - strict-event-emitter@0.2.8: - resolution: {integrity: sha512-KDf/ujU8Zud3YaLtMCcTI4xkZlZVIYxTLr+XIULexP+77EEVWixeXroLUXQXiVtH4XH2W7jr/3PT1v3zBuvc3A==} - - strict-event-emitter@0.4.6: - resolution: {integrity: sha512-12KWeb+wixJohmnwNFerbyiBrAlq5qJLwIt38etRtKtmmHyDSoGlIqFE9wx+4IwG0aDjI7GV8tc8ZccjWZZtTg==} + strict-event-emitter@0.5.1: + resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} strict-uri-encode@1.1.0: resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==} @@ -9000,9 +9003,6 @@ packages: through2@2.0.5: resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} - through@2.3.8: - resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - timed-out@4.0.1: resolution: {integrity: sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==} engines: {node: '>=0.10.0'} @@ -9175,9 +9175,9 @@ packages: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} - type-fest@2.19.0: - resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} - engines: {node: '>=12.20'} + type-fest@4.30.0: + resolution: {integrity: sha512-G6zXWS1dLj6eagy6sVhOMQiLtJdxQBHIA9Z6HFUNLOlr6MFOgzV8wvmidtPONfPtEUv0uZsy77XJNzTAfwPDaA==} + engines: {node: '>=16'} type-is@1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} @@ -9586,9 +9586,6 @@ packages: wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - web-encoding@1.1.5: - resolution: {integrity: sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==} - web-streams-polyfill@3.3.3: resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} engines: {node: '>= 8'} @@ -10125,6 +10122,10 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + yoctocolors-cjs@2.1.2: + resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} + engines: {node: '>=18'} + youch@3.3.3: resolution: {integrity: sha512-qSFXUk3UZBLfggAW3dJKg0BMblG5biqSF8M34E06o5CSsZtH92u9Hqmj2RzGiHDi64fhe83+4tENFP2DB6t6ZA==} @@ -11399,6 +11400,19 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} + '@bundled-es-modules/cookie@2.0.1': + dependencies: + cookie: 0.7.2 + + '@bundled-es-modules/statuses@1.0.1': + dependencies: + statuses: 2.0.1 + + '@bundled-es-modules/tough-cookie@0.1.6': + dependencies: + '@types/tough-cookie': 4.0.5 + tough-cookie: 4.1.4 + '@cloudflare/kv-asset-handler@0.3.2': dependencies: mime: 3.0.0 @@ -12102,6 +12116,32 @@ snapshots: transitivePeerDependencies: - supports-color + '@inquirer/confirm@5.1.0(@types/node@18.19.33)': + dependencies: + '@inquirer/core': 10.1.1(@types/node@18.19.33) + '@inquirer/type': 3.0.1(@types/node@18.19.33) + '@types/node': 18.19.33 + + '@inquirer/core@10.1.1(@types/node@18.19.33)': + dependencies: + '@inquirer/figures': 1.0.8 + '@inquirer/type': 3.0.1(@types/node@18.19.33) + ansi-escapes: 4.3.2 + cli-width: 4.1.0 + mute-stream: 2.0.0 + signal-exit: 4.1.0 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + yoctocolors-cjs: 2.1.2 + transitivePeerDependencies: + - '@types/node' + + '@inquirer/figures@1.0.8': {} + + '@inquirer/type@3.0.1(@types/node@18.19.33)': + dependencies: + '@types/node': 18.19.33 + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -12472,23 +12512,14 @@ snapshots: '@motionone/dom': 10.17.0 tslib: 2.6.3 - '@mswjs/cookies@0.2.2': - dependencies: - '@types/set-cookie-parser': 2.4.7 - set-cookie-parser: 2.6.0 - - '@mswjs/interceptors@0.17.10': + '@mswjs/interceptors@0.37.3': dependencies: - '@open-draft/until': 1.0.3 - '@types/debug': 4.1.12 - '@xmldom/xmldom': 0.8.10 - debug: 4.3.6(supports-color@5.5.0) - headers-polyfill: 3.2.5 - outvariant: 1.4.2 - strict-event-emitter: 0.2.8 - web-encoding: 1.1.5 - transitivePeerDependencies: - - supports-color + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/logger': 0.3.0 + '@open-draft/until': 2.1.0 + is-node-process: 1.2.0 + outvariant: 1.4.3 + strict-event-emitter: 0.5.1 '@multiformats/sha3@2.0.17': dependencies: @@ -12656,7 +12687,14 @@ snapshots: '@nomicfoundation/solidity-analyzer-win32-ia32-msvc': 0.1.1 '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.1.1 - '@open-draft/until@1.0.3': {} + '@open-draft/deferred-promise@2.2.0': {} + + '@open-draft/logger@0.3.0': + dependencies: + is-node-process: 1.2.0 + outvariant: 1.4.3 + + '@open-draft/until@2.1.0': {} '@openzeppelin/contract-loader@0.6.3': dependencies: @@ -13902,7 +13940,7 @@ snapshots: '@types/node': 18.19.44 '@types/responselike': 1.0.3 - '@types/cookie@0.4.1': {} + '@types/cookie@0.6.0': {} '@types/debug@4.1.12': dependencies: @@ -13947,8 +13985,6 @@ snapshots: '@types/js-cookie@2.2.7': {} - '@types/js-levenshtein@1.1.3': {} - '@types/json-schema@7.0.15': {} '@types/json5@0.0.29': {} @@ -14023,18 +14059,18 @@ snapshots: '@types/semver@7.5.8': {} - '@types/set-cookie-parser@2.4.7': - dependencies: - '@types/node': 18.19.44 - '@types/stack-utils@2.0.3': {} + '@types/statuses@2.0.5': {} + '@types/styled-components@5.1.23': dependencies: '@types/hoist-non-react-statics': 3.3.5 '@types/react': 18.2.21 csstype: 3.1.3 + '@types/tough-cookie@4.0.5': {} + '@types/trusted-types@2.0.7': {} '@types/ws@8.5.10': @@ -14760,17 +14796,12 @@ snapshots: '@webassemblyjs/ast': 1.12.1 '@xtuc/long': 4.2.2 - '@xmldom/xmldom@0.8.10': {} - '@xobotyi/scrollbar-width@1.9.5': {} '@xtuc/ieee754@1.2.0': {} '@xtuc/long@4.2.2': {} - '@zxing/text-encoding@0.9.0': - optional: true - abbrev@1.1.1: {} abitype@1.0.5(typescript@5.4.5)(zod@3.23.8): @@ -15348,8 +15379,6 @@ snapshots: upper-case: 1.1.3 upper-case-first: 1.1.2 - chardet@0.7.0: {} - check-error@1.0.3: dependencies: get-func-name: 2.0.2 @@ -15449,7 +15478,7 @@ snapshots: cli-spinners@2.9.2: {} - cli-width@3.0.0: {} + cli-width@4.1.0: {} client-only@0.0.1: {} @@ -15615,6 +15644,8 @@ snapshots: cookie@0.6.0: {} + cookie@0.7.2: {} + copy-to-clipboard@3.3.3: dependencies: toggle-selection: 1.0.6 @@ -16743,12 +16774,6 @@ snapshots: readable-stream: 4.5.2 webextension-polyfill: 0.10.0 - external-editor@3.1.0: - dependencies: - chardet: 0.7.0 - iconv-lite: 0.4.24 - tmp: 0.0.33 - extract-files@9.0.0: {} extsprintf@1.3.0: {} @@ -16808,10 +16833,6 @@ snapshots: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 - figures@3.2.0: - dependencies: - escape-string-regexp: 1.0.5 - file-entry-cache@6.0.1: dependencies: flat-cache: 3.2.0 @@ -17334,7 +17355,7 @@ snapshots: no-case: 2.3.2 upper-case: 1.1.3 - headers-polyfill@3.2.5: {} + headers-polyfill@4.0.3: {} hermes-estree@0.19.1: {} @@ -17538,24 +17559,6 @@ snapshots: css-in-js-utils: 3.1.0 fast-loops: 1.1.3 - inquirer@8.2.6: - dependencies: - ansi-escapes: 4.3.2 - chalk: 4.1.2 - cli-cursor: 3.1.0 - cli-width: 3.0.0 - external-editor: 3.1.0 - figures: 3.2.0 - lodash: 4.17.21 - mute-stream: 0.0.8 - ora: 5.4.1 - run-async: 2.4.1 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - through: 2.3.8 - wrap-ansi: 6.2.0 - intl-segmenter-polyfill@0.4.4: dependencies: fast-text-encoding: 1.0.6 @@ -17815,8 +17818,6 @@ snapshots: js-cookie@2.2.1: {} - js-levenshtein@1.1.6: {} - js-sha3@0.5.5: {} js-sha3@0.5.7: {} @@ -18654,32 +18655,30 @@ snapshots: ms@2.1.3: {} - msw@1.3.3(encoding@0.1.13)(typescript@5.4.5): - dependencies: - '@mswjs/cookies': 0.2.2 - '@mswjs/interceptors': 0.17.10 - '@open-draft/until': 1.0.3 - '@types/cookie': 0.4.1 - '@types/js-levenshtein': 1.1.3 + msw@2.6.8(@types/node@18.19.33)(typescript@5.4.5): + dependencies: + '@bundled-es-modules/cookie': 2.0.1 + '@bundled-es-modules/statuses': 1.0.1 + '@bundled-es-modules/tough-cookie': 0.1.6 + '@inquirer/confirm': 5.1.0(@types/node@18.19.33) + '@mswjs/interceptors': 0.37.3 + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/until': 2.1.0 + '@types/cookie': 0.6.0 + '@types/statuses': 2.0.5 chalk: 4.1.2 - chokidar: 3.6.0 - cookie: 0.4.2 graphql: 16.8.1 - headers-polyfill: 3.2.5 - inquirer: 8.2.6 + headers-polyfill: 4.0.3 is-node-process: 1.2.0 - js-levenshtein: 1.1.6 - node-fetch: 2.7.0(encoding@0.1.13) - outvariant: 1.4.2 - path-to-regexp: 6.2.2 - strict-event-emitter: 0.4.6 - type-fest: 2.19.0 + outvariant: 1.4.3 + path-to-regexp: 6.3.0 + strict-event-emitter: 0.5.1 + type-fest: 4.30.0 yargs: 17.7.2 optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: - - encoding - - supports-color + - '@types/node' multibase@0.6.1: dependencies: @@ -18718,7 +18717,7 @@ snapshots: mustache@4.2.0: {} - mute-stream@0.0.8: {} + mute-stream@2.0.0: {} nan@2.19.0: {} @@ -19009,7 +19008,7 @@ snapshots: outdent@0.8.0: {} - outvariant@1.4.2: {} + outvariant@1.4.3: {} p-cancelable@2.1.1: {} @@ -19126,6 +19125,8 @@ snapshots: path-to-regexp@6.2.2: {} + path-to-regexp@6.3.0: {} + path-type@1.1.0: dependencies: graceful-fs: 4.2.11 @@ -19858,8 +19859,6 @@ snapshots: dependencies: '@babel/runtime': 7.24.6 - run-async@2.4.1: {} - run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 @@ -19982,8 +19981,6 @@ snapshots: set-blocking@2.0.0: {} - set-cookie-parser@2.6.0: {} - set-harmonic-interval@1.0.1: {} setimmediate@1.0.4: {} @@ -20233,11 +20230,7 @@ snapshots: streamsearch@1.1.0: {} - strict-event-emitter@0.2.8: - dependencies: - events: 3.3.0 - - strict-event-emitter@0.4.6: {} + strict-event-emitter@0.5.1: {} strict-uri-encode@1.1.0: {} @@ -20612,8 +20605,6 @@ snapshots: readable-stream: 2.3.8 xtend: 4.0.2 - through@2.3.8: {} - timed-out@4.0.1: {} tinybench@2.8.0: {} @@ -20752,7 +20743,7 @@ snapshots: type-fest@0.8.1: {} - type-fest@2.19.0: {} + type-fest@4.30.0: {} type-is@1.6.18: dependencies: @@ -21166,12 +21157,6 @@ snapshots: dependencies: defaults: 1.0.4 - web-encoding@1.1.5: - dependencies: - util: 0.12.5 - optionalDependencies: - '@zxing/text-encoding': 0.9.0 - web-streams-polyfill@3.3.3: {} web3-bzz@1.10.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): @@ -21979,6 +21964,8 @@ snapshots: yocto-queue@0.1.0: {} + yoctocolors-cjs@2.1.2: {} + youch@3.3.3: dependencies: cookie: 0.5.0 diff --git a/src/components/pages/profile/[name]/tabs/MoreTab/Miscellaneous/useSubscribeToEarnifi.test.ts b/src/components/pages/profile/[name]/tabs/MoreTab/Miscellaneous/useSubscribeToEarnifi.test.ts index 36ce5ea5c..45dcfd069 100644 --- a/src/components/pages/profile/[name]/tabs/MoreTab/Miscellaneous/useSubscribeToEarnifi.test.ts +++ b/src/components/pages/profile/[name]/tabs/MoreTab/Miscellaneous/useSubscribeToEarnifi.test.ts @@ -1,18 +1,18 @@ import { act, renderHook, waitFor } from '@app/test-utils' -import { rest } from 'msw' +import { HttpResponse, http } from 'msw' import { setupServer } from 'msw/node' import { afterAll, afterEach, beforeAll, describe, expect, it, test, vi } from 'vitest' import { EARNIFI_ENDPOINT, getErrorMessage, useSubscribeToEarnifi } from './useSubscribeToEarnifi' export const handlers = [ - rest.post(EARNIFI_ENDPOINT, async (req, res, ctx) => { - const { email, address, chainId } = await req.json() + http.post(EARNIFI_ENDPOINT, async (req) => { + const { email, address, chainId } = (await req.request.json()) as Record if (email && address && chainId) { - return res(ctx.status(200)) + return HttpResponse.json({}, {status: 200}) } - return res(ctx.status(400), ctx.json({ message: 'Bad Request' })) + return HttpResponse.json({ message: 'Bad Request' }, {status: 400}) }), ] diff --git a/src/utils/SyncProvider/SyncDroppedTransaction.test.tsx b/src/utils/SyncProvider/SyncDroppedTransaction.test.tsx index 007789c31..be83edba4 100644 --- a/src/utils/SyncProvider/SyncDroppedTransaction.test.tsx +++ b/src/utils/SyncProvider/SyncDroppedTransaction.test.tsx @@ -1,6 +1,6 @@ import { mockFunction, render } from '@app/test-utils' -import { rest } from 'msw' +import { http, HttpResponse } from 'msw' import { setupServer } from 'msw/node' import { getTransaction, getTransactionCount } from 'viem/actions' import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest' @@ -27,17 +27,10 @@ vi.mock('@app/hooks/transactions/TransactionStoreContext') const ADDRESS = '0x1234567890abcdef' export const handlers = [ - rest.get(getAccountHistoryEndpoint(ADDRESS, 1), (req, res, ctx) => { - return res( - ctx.status(200), - ctx.json([ - { - hash: '0xabc123', - input: 'input', - timeStamp: '1', - nonce: 0, - }, - ]), + http.get(getAccountHistoryEndpoint(ADDRESS, 1), () => { + return HttpResponse.json( + { hash: '0xabc123', input: 'input', timeStamp: '1', nonce: 0 }, + { status: 200 }, ) }), ] @@ -177,10 +170,9 @@ describe('findDroppedTransactions', () => { }) it('should error if there is more than one transaction that could be a replacement', async () => { server.use( - rest.get(getAccountHistoryEndpoint(ADDRESS, 1), (req, res, ctx) => { - return res( - ctx.status(200), - ctx.json([ + http.get(getAccountHistoryEndpoint(ADDRESS, 1), () => { + return HttpResponse.json( + [ { hash: '0xabc123', input: 'input', @@ -191,7 +183,8 @@ describe('findDroppedTransactions', () => { input: 'input', timeStamp: '1', }, - ]), + ], + { status: 200 }, ) }), ) diff --git a/src/utils/date.test.ts b/src/utils/date.test.ts index eedcc6db9..957fb6c4a 100644 --- a/src/utils/date.test.ts +++ b/src/utils/date.test.ts @@ -155,21 +155,23 @@ describe('secondsFromDateDiff', () => { describe('calculateDateDiff', () => { it.each([ ['2024-01-10', '2025-01-10', '1-0-0'], - ['2024-01-10', '2024-02-10', '0-1-0' ], - ['2024-01-10', '2024-01-11', '0-0-1' ], + ['2024-01-10', '2024-02-10', '0-1-0'], + ['2024-01-10', '2024-01-11', '0-0-1'], ['2024-01-10', '2025-01-9', '0-11-30'], ['2024-03-10', '2025-03-9', '0-11-27'], ['2023-03-10', '2024-03-9', '0-11-28'], // leap year ['2024-04-10', '2025-04-9', '0-11-30'], - ['2024-04-10', '2025-04-10', '1-0-0' ], - ['2024-11-10', '2026-05-1', '1-5-21' ], + ['2024-04-10', '2025-04-10', '1-0-0'], + ['2024-11-10', '2026-05-1', '1-5-21'], ])(`should return correct diff from %s to %s`, (date1, date2, result) => { const startDate = new Date(date1) const endDate = new Date(date2) - const toUnit = (i: number) => i === 0 ? 'years' : i === 1 ? 'months' : 'days' - const dateDiff = Object.fromEntries(result.split('-').map((value, i) => [toUnit(i),parseInt(value)])) + const toUnit = (i: number) => (i === 0 ? 'years' : i === 1 ? 'months' : 'days') + const dateDiff = Object.fromEntries( + result.split('-').map((value, i) => [toUnit(i), parseInt(value)]), + ) - expect(calculateDatesDiff(startDate, endDate)).toEqual({ diff: dateDiff, isNegative: false}) + expect(calculateDatesDiff(startDate, endDate)).toEqual({ diff: dateDiff, isNegative: false }) }) -}) \ No newline at end of file +}) diff --git a/src/utils/query/reactQuery.test.tsx b/src/utils/query/reactQuery.test.tsx index 5ac7c41da..537454240 100644 --- a/src/utils/query/reactQuery.test.tsx +++ b/src/utils/query/reactQuery.test.tsx @@ -1,12 +1,12 @@ import { render, waitFor } from '@app/test-utils' import { QueryClientProvider } from '@tanstack/react-query' -import { useQuery } from './useQuery' import { PropsWithChildren, ReactNode } from 'react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { WagmiProvider } from 'wagmi' import { queryClient } from './reactQuery' +import { useQuery } from './useQuery' import { wagmiConfig } from './wagmi' const mockFetchData = vi.fn().mockResolvedValue('Test data') @@ -64,7 +64,7 @@ describe('reactQuery', () => { it('should not refetch query on rerender', async () => { const { getByTestId, rerender } = render( - + , ) @@ -75,7 +75,7 @@ describe('reactQuery', () => { rerender( - + , ) @@ -88,7 +88,7 @@ describe('reactQuery', () => { it('should refetch query on mount', async () => { const { getByTestId, unmount } = render( - + , ) @@ -100,7 +100,7 @@ describe('reactQuery', () => { unmount() const { getByTestId: getByTestId2 } = render( - + , ) @@ -114,7 +114,7 @@ describe('reactQuery', () => { const { getByTestId, unmount } = render( - + , ) @@ -129,7 +129,7 @@ describe('reactQuery', () => { const { getByTestId: getByTestId2 } = render( - + , ) diff --git a/src/utils/records/categoriseProfileTextRecords.test.ts b/src/utils/records/categoriseProfileTextRecords.test.ts index 8aa6229c4..26a1ff170 100644 --- a/src/utils/records/categoriseProfileTextRecords.test.ts +++ b/src/utils/records/categoriseProfileTextRecords.test.ts @@ -1,13 +1,14 @@ -import { vi, describe, it, expect } from 'vitest' +import { describe, expect, it, vi } from 'vitest' + import { categoriseAndTransformTextRecords } from './categoriseProfileTextRecords' describe('categoriseProfileTextRecords', () => { it('should return text records correctly categorised', () => { const result = categoriseAndTransformTextRecords({ texts: [ - { key: 'com.twitter', value: 'name'}, - { key: 'other', value: 'value'}, - { key: 'description', value: 'description'}, + { key: 'com.twitter', value: 'name' }, + { key: 'other', value: 'value' }, + { key: 'description', value: 'description' }, ], contentHash: 'ipfs://contenthash', appendVerificationProps: (record: any) => ({ @@ -17,7 +18,7 @@ describe('categoriseProfileTextRecords', () => { }), }) expect(result).toEqual({ - general: [ { key: 'description', value: 'description' } ], + general: [{ key: 'description', value: 'description' }], accounts: [ { key: 'com.twitter', @@ -25,8 +26,8 @@ describe('categoriseProfileTextRecords', () => { value: '@name', isVerified: true, verifiers: ['dentity'], - iconKey: 'com.twitter' - } + iconKey: 'com.twitter', + }, ], other: [ { key: 'other', value: 'value', type: 'text', iconKey: 'other' }, @@ -34,18 +35,18 @@ describe('categoriseProfileTextRecords', () => { key: 'contenthash', value: 'ipfs://contenthash', type: 'contenthash', - iconKey: 'contenthash' - } - ] + iconKey: 'contenthash', + }, + ], }) }) it('should not return a contenthash record item if it is undefined', () => { const result = categoriseAndTransformTextRecords({ texts: [ - { key: 'com.twitter', value: 'name'}, - { key: 'other', value: 'value'}, - { key: 'description', value: 'description'}, + { key: 'com.twitter', value: 'name' }, + { key: 'other', value: 'value' }, + { key: 'description', value: 'description' }, ], contentHash: undefined, appendVerificationProps: (record: any) => ({ @@ -55,7 +56,7 @@ describe('categoriseProfileTextRecords', () => { }), }) expect(result).toEqual({ - general: [ { key: 'description', value: 'description' } ], + general: [{ key: 'description', value: 'description' }], accounts: [ { key: 'com.twitter', @@ -63,12 +64,10 @@ describe('categoriseProfileTextRecords', () => { value: '@name', isVerified: true, verifiers: ['dentity'], - iconKey: 'com.twitter' - } + iconKey: 'com.twitter', + }, ], - other: [ - { key: 'other', value: 'value', type: 'text', iconKey: 'other' }, - ] + other: [{ key: 'other', value: 'value', type: 'text', iconKey: 'other' }], }) }) }) diff --git a/src/utils/utils.test.ts b/src/utils/utils.test.ts index fd75a6388..a71515796 100644 --- a/src/utils/utils.test.ts +++ b/src/utils/utils.test.ts @@ -131,7 +131,7 @@ describe('formatDurationOfDates', () => { formatDurationOfDates({ startDate: new Date(), endDate: new Date(Date.now() + 123 * 1000), - t: (x, options: any) => x + options?.count, + t: (x, options: any) => x + options?.count, }), ).toEqual('unit.days0') }) diff --git a/src/utils/verification/isVerificationProtocol.test.ts b/src/utils/verification/isVerificationProtocol.test.ts index d04ebca23..3b77b0758 100644 --- a/src/utils/verification/isVerificationProtocol.test.ts +++ b/src/utils/verification/isVerificationProtocol.test.ts @@ -1,5 +1,6 @@ -import { isVerificationProtocol } from "./isVerificationProtocol"; -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from 'vitest' + +import { isVerificationProtocol } from './isVerificationProtocol' describe('isVerificationProtocol', () => { it.each(['dentity'])('should return true for protocol: %s', (protocol) => { From 8db1feee8fd4c7b466fe942389e7dc0923670757 Mon Sep 17 00:00:00 2001 From: v1rtl Date: Mon, 9 Dec 2024 15:21:57 +0200 Subject: [PATCH 2/2] fix error --- .../MoreTab/Miscellaneous/useSubscribeToEarnifi.test.ts | 4 ++-- src/utils/SyncProvider/SyncDroppedTransaction.test.tsx | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/pages/profile/[name]/tabs/MoreTab/Miscellaneous/useSubscribeToEarnifi.test.ts b/src/components/pages/profile/[name]/tabs/MoreTab/Miscellaneous/useSubscribeToEarnifi.test.ts index 45dcfd069..bd604c4e4 100644 --- a/src/components/pages/profile/[name]/tabs/MoreTab/Miscellaneous/useSubscribeToEarnifi.test.ts +++ b/src/components/pages/profile/[name]/tabs/MoreTab/Miscellaneous/useSubscribeToEarnifi.test.ts @@ -7,8 +7,8 @@ import { afterAll, afterEach, beforeAll, describe, expect, it, test, vi } from ' import { EARNIFI_ENDPOINT, getErrorMessage, useSubscribeToEarnifi } from './useSubscribeToEarnifi' export const handlers = [ - http.post(EARNIFI_ENDPOINT, async (req) => { - const { email, address, chainId } = (await req.request.json()) as Record + http.post(EARNIFI_ENDPOINT, async ({request}) => { + const { email, address, chainId } = (await request.json()) as Record if (email && address && chainId) { return HttpResponse.json({}, {status: 200}) } diff --git a/src/utils/SyncProvider/SyncDroppedTransaction.test.tsx b/src/utils/SyncProvider/SyncDroppedTransaction.test.tsx index be83edba4..59e8b59e7 100644 --- a/src/utils/SyncProvider/SyncDroppedTransaction.test.tsx +++ b/src/utils/SyncProvider/SyncDroppedTransaction.test.tsx @@ -28,10 +28,9 @@ const ADDRESS = '0x1234567890abcdef' export const handlers = [ http.get(getAccountHistoryEndpoint(ADDRESS, 1), () => { - return HttpResponse.json( - { hash: '0xabc123', input: 'input', timeStamp: '1', nonce: 0 }, - { status: 200 }, - ) + return HttpResponse.json([{ hash: '0xabc123', input: 'input', timeStamp: '1', nonce: 0 }], { + status: 200, + }) }), ]