diff --git a/jest.config.ts b/jest.config.ts index fe8cbe6a4..e388d1842 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -2,7 +2,10 @@ import type { Config } from 'jest'; const config: Config = { preset: 'ts-jest', - setupFiles: ['/src/renderer/__helpers__/setupEnvVars.js'], + setupFiles: [ + '/src/renderer/__helpers__/setupEnvVars.js', + '/src/renderer/__helpers__/setupPrimerJest.js', + ], testEnvironment: 'jsdom', collectCoverage: true, collectCoverageFrom: ['src/**/*', '!**/__snapshots__/**'], diff --git a/package.json b/package.json index 0e4e9d014..734358a58 100644 --- a/package.json +++ b/package.json @@ -140,6 +140,7 @@ "@discordapp/twemoji": "15.1.0", "@electron/notarize": "2.5.0", "@primer/octicons-react": "19.12.0", + "@primer/react": "36.27.0", "@testing-library/react": "16.0.1", "@types/jest": "29.5.13", "@types/node": "20.16.11", @@ -148,7 +149,6 @@ "@types/react-router-dom": "5.3.3", "autoprefixer": "10.4.20", "axios": "1.7.7", - "class-variance-authority": "0.7.0", "clsx": "2.1.1", "concurrently": "9.0.1", "copy-webpack-plugin": "12.0.2", @@ -170,8 +170,9 @@ "postcss-loader": "8.1.1", "react-final-form": "6.5.9", "rimraf": "6.0.1", + "styled-components": "6.1.13", "tailwind-merge": "2.5.4", - "tailwindcss": "3.4.13", + "tailwindcss": "3.4.14", "terser-webpack-plugin": "5.3.10", "ts-jest": "29.2.5", "ts-loader": "9.5.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13943c2b0..0405c46ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,6 +45,9 @@ importers: '@primer/octicons-react': specifier: 19.12.0 version: 19.12.0(react@18.3.1) + '@primer/react': + specifier: 36.27.0 + version: 36.27.0(@types/react-dom@18.2.22)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@testing-library/react': specifier: 16.0.1 version: 16.0.1(@testing-library/dom@10.0.0)(@types/react-dom@18.2.22)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -69,9 +72,6 @@ importers: axios: specifier: 1.7.7 version: 1.7.7 - class-variance-authority: - specifier: 0.7.0 - version: 0.7.0 clsx: specifier: 2.1.1 version: 2.1.1 @@ -135,12 +135,15 @@ importers: rimraf: specifier: 6.0.1 version: 6.0.1 + styled-components: + specifier: 6.1.13 + version: 6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1) tailwind-merge: specifier: 2.5.4 version: 2.5.4 tailwindcss: - specifier: 3.4.13 - version: 3.4.13(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)) + specifier: 3.4.14 + version: 3.4.14(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)) terser-webpack-plugin: specifier: 5.3.10 version: 5.3.10(webpack@5.95.0) @@ -463,9 +466,33 @@ packages: resolution: {integrity: sha512-fKpv9kg4SPmt+hY7SVBnIYULE9QJl8L3sCfcBsnqbJwwBwAeTLokJ9TRt9y7bK0JAzIW2y78TVVjvnQEms/yyA==} engines: {node: '>=16.4'} + '@emotion/is-prop-valid@1.2.2': + resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} + + '@emotion/memoize@0.8.1': + resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} + + '@emotion/unitless@0.8.1': + resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} + '@gar/promisify@1.1.3': resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} + '@github/combobox-nav@2.3.1': + resolution: {integrity: sha512-gwxPzLw8XKecy1nP63i9lOBritS3bWmxl02UX6G0TwMQZbMem1BCS1tEZgYd3mkrkiDrUMWaX+DbFCuDFo3K+A==} + + '@github/markdown-toolbar-element@2.2.3': + resolution: {integrity: sha512-AlquKGee+IWiAMYVB0xyHFZRMnu4n3X4HTvJHu79GiVJ1ojTukCWyxMlF5NMsecoLcBKsuBhx3QPv2vkE/zQ0A==} + + '@github/paste-markdown@1.5.3': + resolution: {integrity: sha512-PzZ1b3PaqBzYqbT4fwKEhiORf38h2OcGp2+JdXNNM7inZ7egaSmfmhyNkQILpqWfS0AYtRS3CDq6z03eZ8yOMQ==} + + '@github/relative-time-element@4.4.3': + resolution: {integrity: sha512-EVKokqx9/DdUAZ2l9WVyY51EtRCO2gQWWMvsRIn7r4glJ91q9CXcnILVHZVCpfD52ucXUhUvtYsAjNJ4qP4uIg==} + + '@github/tab-container-element@4.8.2': + resolution: {integrity: sha512-WkaM4mfs8x7dXRWEaDb5deC0OhH6sGQ5cw8i/sVw25gikl4f8C7mHj0kihL5k3eKIIqmGT1Fdswdoi+9ZLDpRA==} + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -568,6 +595,12 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + '@lit-labs/react@1.2.1': + resolution: {integrity: sha512-DiZdJYFU0tBbdQkfwwRSwYyI/mcWkg3sWesKRsHUd4G+NekTmmeq9fzsurvcKTNVa0comNljwtg4Hvi1ds3V+A==} + + '@lit-labs/ssr-dom-shim@1.2.1': + resolution: {integrity: sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==} + '@malept/cross-spawn-promise@1.1.1': resolution: {integrity: sha512-RTBGWL5FWQcg9orDOCcp4LvItNzUPcyEU9bwaeJX0rJ1IQxzucC48Y0/sQLp/g6t99IQgAlGIaesJS+gTn7tVQ==} engines: {node: '>= 10'} @@ -601,16 +634,52 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} deprecated: This functionality has been moved to @npmcli/fs + '@oddbird/popover-polyfill@0.3.8': + resolution: {integrity: sha512-+aK7EHL3VggfsWGVqUwvtli2+kP5OWyseAsrefhzR2XWoi2oALUCeoDn63i5WS3ZOmLiXHRNBwHPeta8w+aM1g==} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} + '@primer/behaviors@1.7.2': + resolution: {integrity: sha512-I5dGgtzV9n1ZX3J1KHkLVWjvEbzanstaXFTDr/+tdn4E2GAA/NUHfTLMq6i5+Pt4P/p/paLI50EgExElENzCYQ==} + + '@primer/live-region-element@0.7.1': + resolution: {integrity: sha512-9uQCeBCb3wefz3kJNSo+PECc7T7TNB3k22JUdHY08Zlv9bd1rtsQgpazM5umcbZQrACzGbgufAfdbhGUBXI3jA==} + + '@primer/octicons-react@19.11.0': + resolution: {integrity: sha512-8PpCz7cpYY2GCGnJ/G9UARh9PH4C290l31YjriQHZ+WsagE37ntKXhFwq+s4OWoRqZ7fA7HeU81zGDFHQi0VKg==} + engines: {node: '>=8'} + peerDependencies: + react: '>=16.3' + '@primer/octicons-react@19.12.0': resolution: {integrity: sha512-xnVzFmeWqqiiv9XYZ0hrlytAlCrSZ+HM3JrRzmD/LiPgdyEhyG/qb/ewMukiDoF9Ckwy4rkd1zuDd3KAx4DIAw==} engines: {node: '>=8'} peerDependencies: react: '>=16.3' + '@primer/primitives@7.17.1': + resolution: {integrity: sha512-SiPzEb+up1nDpV2NGwNiY8m6sGnF3OUqRb0has5s6T40vq6Li/g3cYVgl+oolEa4DUoNygEPs09jwJt24f/3zg==} + + '@primer/react@36.27.0': + resolution: {integrity: sha512-dVyp0f9zbbQYQZ6ztfMET43vVaWhvSz+qWirBzpRjDxvCk8vCQsvWrVGUU/PR0kAxxDHf6hqeLG7vcDL229NLA==} + engines: {node: '>=12', npm: '>=7'} + peerDependencies: + '@types/react': ^18.0.0 + '@types/react-dom': ^18.0.0 + '@types/styled-components': ^5.1.11 + react: ^18.0.0 + react-dom: ^18.0.0 + styled-components: 5.x + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + '@types/styled-components': + optional: true + '@remix-run/router@1.20.0': resolution: {integrity: sha512-mUnk8rPJBI9loFDZ+YzPGdeniYK+FTmRD1TMCz7ev2SNIozyKKpnGgsxO34u6Z4z/t0ITuu7voi/AshfsGsgFg==} engines: {node: '>=14.0.0'} @@ -632,6 +701,51 @@ packages: '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + '@styled-system/background@5.1.2': + resolution: {integrity: sha512-jtwH2C/U6ssuGSvwTN3ri/IyjdHb8W9X/g8Y0JLcrH02G+BW3OS8kZdHphF1/YyRklnrKrBT2ngwGUK6aqqV3A==} + + '@styled-system/border@5.1.5': + resolution: {integrity: sha512-JvddhNrnhGigtzWRCVuAHepniyVi6hBlimxWDVAdcTuk7aRn9BYJUwfHslURtwYFsF5FoEs8Zmr1oZq2M1AP0A==} + + '@styled-system/color@5.1.2': + resolution: {integrity: sha512-1kCkeKDZkt4GYkuFNKc7vJQMcOmTl3bJY3YBUs7fCNM6mMYJeT1pViQ2LwBSBJytj3AB0o4IdLBoepgSgGl5MA==} + + '@styled-system/core@5.1.2': + resolution: {integrity: sha512-XclBDdNIy7OPOsN4HBsawG2eiWfCcuFt6gxKn1x4QfMIgeO6TOlA2pZZ5GWZtIhCUqEPTgIBta6JXsGyCkLBYw==} + + '@styled-system/css@5.1.5': + resolution: {integrity: sha512-XkORZdS5kypzcBotAMPBoeckDs9aSZVkvrAlq5K3xP8IMAUek+x2O4NtwoSgkYkWWzVBu6DGdFZLR790QWGG+A==} + + '@styled-system/flexbox@5.1.2': + resolution: {integrity: sha512-6hHV52+eUk654Y1J2v77B8iLeBNtc+SA3R4necsu2VVinSD7+XY5PCCEzBFaWs42dtOEDIa2lMrgL0YBC01mDQ==} + + '@styled-system/grid@5.1.2': + resolution: {integrity: sha512-K3YiV1KyHHzgdNuNlaw8oW2ktMuGga99o1e/NAfTEi5Zsa7JXxzwEnVSDSBdJC+z6R8WYTCYRQC6bkVFcvdTeg==} + + '@styled-system/layout@5.1.2': + resolution: {integrity: sha512-wUhkMBqSeacPFhoE9S6UF3fsMEKFv91gF4AdDWp0Aym1yeMPpqz9l9qS/6vjSsDPF7zOb5cOKC3tcKKOMuDCPw==} + + '@styled-system/position@5.1.2': + resolution: {integrity: sha512-60IZfMXEOOZe3l1mCu6sj/2NAyUmES2kR9Kzp7s2D3P4qKsZWxD1Se1+wJvevb+1TP+ZMkGPEYYXRyU8M1aF5A==} + + '@styled-system/props@5.1.5': + resolution: {integrity: sha512-FXhbzq2KueZpGaHxaDm8dowIEWqIMcgsKs6tBl6Y6S0njG9vC8dBMI6WSLDnzMoSqIX3nSKHmOmpzpoihdDewg==} + + '@styled-system/shadow@5.1.2': + resolution: {integrity: sha512-wqniqYb7XuZM7K7C0d1Euxc4eGtqEe/lvM0WjuAFsQVImiq6KGT7s7is+0bNI8O4Dwg27jyu4Lfqo/oIQXNzAg==} + + '@styled-system/space@5.1.2': + resolution: {integrity: sha512-+zzYpR8uvfhcAbaPXhH8QgDAV//flxqxSjHiS9cDFQQUSznXMQmxJegbhcdEF7/eNnJgHeIXv1jmny78kipgBA==} + + '@styled-system/theme-get@5.1.2': + resolution: {integrity: sha512-afAYdRqrKfNIbVgmn/2Qet1HabxmpRnzhFwttbGr6F/mJ4RDS/Cmn+KHwHvNXangQsWw/5TfjpWV+rgcqqIcJQ==} + + '@styled-system/typography@5.1.2': + resolution: {integrity: sha512-BxbVUnN8N7hJ4aaPOd7wEsudeT7CxarR+2hns8XCX1zp0DFfbWw4xYa/olA0oQaqx7F1hzDg+eRaGzAJbF+jOg==} + + '@styled-system/variant@5.1.5': + resolution: {integrity: sha512-Yn8hXAFoWIro8+Q5J8YJd/mP85Teiut3fsGVR9CAxwgNfIAiqlYxsk5iHU7VHJks/0KjL4ATSjmbtCDC/4l1qw==} + '@szmarczak/http-timer@4.0.6': resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} engines: {node: '>=10'} @@ -708,6 +822,9 @@ packages: '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + '@types/hast@2.3.10': + resolution: {integrity: sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==} + '@types/history@4.7.11': resolution: {integrity: sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==} @@ -738,6 +855,9 @@ packages: '@types/keyv@3.1.4': resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} + '@types/mdast@3.0.15': + resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} + '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} @@ -756,6 +876,9 @@ packages: '@types/react-dom@18.2.22': resolution: {integrity: sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==} + '@types/react-is@18.3.0': + resolution: {integrity: sha512-KZJpHUkAdzyKj/kUHJDc6N7KyidftICufJfOFpiG6haL/BDQNQt5i4n1XDUL/nDZAtGLHDSWRYpLzKTAKSvX6w==} + '@types/react-router-dom@5.3.3': resolution: {integrity: sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==} @@ -771,9 +894,24 @@ packages: '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@types/styled-system@5.1.22': + resolution: {integrity: sha512-NbRp37zWcrf/+Qf2NumdyZfhSx1dzJ50zgfKvnezYJx1HTRUMVYY8jtWvK1eoIAa6F5sXwHLhE8oXNu15ThBAA==} + + '@types/styled-system__css@5.0.21': + resolution: {integrity: sha512-8S1lPbUbrE8U/2btqjh9X6pK9//kQdbQDe9z3vQl4SWtxtqoAVnrFZE6Xs+IHM7NMZ1uC68XrF9nLdzRHm3VyA==} + + '@types/styled-system__theme-get@5.0.4': + resolution: {integrity: sha512-dbzwxQ+8x6Bo3EKZMo9M3Knzo77ukwoC/isKW+GAuF5TenXlPkvgzx4t4+Lp0+fKs2M4owSef0KO3gtGW3Hpkw==} + + '@types/stylis@4.2.5': + resolution: {integrity: sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==} + '@types/tough-cookie@4.0.5': resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} + '@types/unist@2.0.11': + resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} + '@types/verror@1.10.10': resolution: {integrity: sha512-l4MM0Jppn18hb9xmM6wwD1uTdShpf9Pn80aXTStnK1C94gtPvJcV2FrDmbOQUAQfJ1cKZHktkQUDwEqaAKXMMg==} @@ -1077,6 +1215,9 @@ packages: peerDependencies: '@babel/core': ^7.0.0 + bail@2.0.2: + resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1182,6 +1323,9 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} + camelize@1.0.1: + resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} + caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} @@ -1200,6 +1344,9 @@ packages: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} + character-entities@2.0.2: + resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} @@ -1222,9 +1369,6 @@ packages: cjs-module-lexer@1.2.3: resolution: {integrity: sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==} - class-variance-authority@0.7.0: - resolution: {integrity: sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==} - clean-css@5.3.3: resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==} engines: {node: '>= 10.0'} @@ -1260,8 +1404,8 @@ packages: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} - clsx@2.0.0: - resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==} + clsx@1.2.1: + resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} engines: {node: '>=6'} clsx@2.1.1: @@ -1292,6 +1436,9 @@ packages: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true + color2k@2.0.3: + resolution: {integrity: sha512-zW190nQTIoXcGCaU08DvVNFTmQhUpnJfVuAKfWqUQkflXKpaDdpaYoM0iluLS9lgJNHyBF58KKA2FBEwkD7wog==} + colord@2.9.3: resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} @@ -1302,6 +1449,9 @@ packages: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} + comma-separated-tokens@2.0.3: + resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} @@ -1398,6 +1548,10 @@ packages: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} + css-color-keywords@1.0.0: + resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} + engines: {node: '>=4'} + css-declaration-sorter@7.2.0: resolution: {integrity: sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow==} engines: {node: ^14 || ^16 || >=18} @@ -1447,6 +1601,9 @@ packages: css-select@5.1.0: resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} + css-to-react-native@3.2.0: + resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} + css-tree@2.2.1: resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} @@ -1518,6 +1675,9 @@ packages: decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} + decode-named-character-reference@1.0.2: + resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} + decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -1582,6 +1742,10 @@ packages: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} + diff@5.2.0: + resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} + engines: {node: '>=0.3.1'} + dir-compare@3.3.0: resolution: {integrity: sha512-J7/et3WlGUCxjdnD3HAAzQ6nsnc0WL6DD7WcwJb7c39iH1+AWfg+9OqzJNaI6PkBwBvm1mhZNL9iY/nRiZXlPg==} @@ -1817,6 +1981,9 @@ packages: exponential-backoff@3.1.1: resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==} + extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + extract-zip@2.0.1: resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==} engines: {node: '>= 10.17.0'} @@ -1871,6 +2038,9 @@ packages: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true + focus-visible@5.2.1: + resolution: {integrity: sha512-8Bx950VD1bWTQJEH/AM6SpEk+SU55aVnp4Ujhuuxy3eMEBCRwBnTBnVXr9YAPvZL3/CNjCa8u4IWfNmEO53whA==} + follow-redirects@1.15.6: resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} engines: {node: '>=4.0'} @@ -1925,6 +2095,9 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + fzy.js@0.4.1: + resolution: {integrity: sha512-4sPVXf+9oGhzg2tYzgWe4hgAY0wEbkqeuKVEgdnqX8S8VcLosQsDjb0jV+f5uoQlf8INWId1w0IGoufAoik1TA==} + gauge@4.0.4: resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -2048,10 +2221,16 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + hast-util-whitespace@2.0.1: + resolution: {integrity: sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==} + he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + history@5.3.0: + resolution: {integrity: sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==} + hosted-git-info@4.1.0: resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} engines: {node: '>=10'} @@ -2167,6 +2346,9 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + inline-style-parser@0.1.1: + resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} + interpret@3.1.1: resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} engines: {node: '>=10.13.0'} @@ -2182,6 +2364,10 @@ packages: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} + is-buffer@2.0.5: + resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} + engines: {node: '>=4'} + is-ci@3.0.1: resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} hasBin: true @@ -2216,6 +2402,10 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + is-plain-object@2.0.4: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} @@ -2502,6 +2692,10 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} + kleur@4.1.5: + resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} + engines: {node: '>=6'} + lazy-val@1.0.5: resolution: {integrity: sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==} @@ -2517,10 +2711,6 @@ packages: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} - lilconfig@3.1.1: - resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==} - engines: {node: '>=14'} - lilconfig@3.1.2: resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} engines: {node: '>=14'} @@ -2548,9 +2738,15 @@ packages: lodash.flatten@4.4.0: resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} + lodash.isempty@4.4.0: + resolution: {integrity: sha512-oKMuF3xEeqDltrGMfDxAPGIVMSSRv8tbRSODbrs4KGsRRLEhrW8N8Rd4DRgB2+621hY8A8XwwrTVhXWpxFvMzg==} + lodash.isequal@4.5.0: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + lodash.isobject@3.0.2: + resolution: {integrity: sha512-3/Qptq2vr7WeJbB4KHUSKlq8Pl7ASXi3UG6CMbBm8WRtXi8+GHm7mKaU3urfpSEzWe2wCIChs6/sdocUsTKJiA==} + lodash.isplainobject@4.0.6: resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} @@ -2622,6 +2818,18 @@ packages: resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==} engines: {node: '>=10'} + mdast-util-definitions@5.1.2: + resolution: {integrity: sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==} + + mdast-util-from-markdown@1.3.1: + resolution: {integrity: sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==} + + mdast-util-to-hast@12.3.0: + resolution: {integrity: sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==} + + mdast-util-to-string@3.2.0: + resolution: {integrity: sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==} + mdn-data@2.0.28: resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} @@ -2640,6 +2848,69 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + micromark-core-commonmark@1.1.0: + resolution: {integrity: sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==} + + micromark-factory-destination@1.1.0: + resolution: {integrity: sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==} + + micromark-factory-label@1.1.0: + resolution: {integrity: sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==} + + micromark-factory-space@1.1.0: + resolution: {integrity: sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==} + + micromark-factory-title@1.1.0: + resolution: {integrity: sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==} + + micromark-factory-whitespace@1.1.0: + resolution: {integrity: sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==} + + micromark-util-character@1.2.0: + resolution: {integrity: sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==} + + micromark-util-chunked@1.1.0: + resolution: {integrity: sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==} + + micromark-util-classify-character@1.1.0: + resolution: {integrity: sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==} + + micromark-util-combine-extensions@1.1.0: + resolution: {integrity: sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==} + + micromark-util-decode-numeric-character-reference@1.1.0: + resolution: {integrity: sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==} + + micromark-util-decode-string@1.1.0: + resolution: {integrity: sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==} + + micromark-util-encode@1.1.0: + resolution: {integrity: sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==} + + micromark-util-html-tag-name@1.2.0: + resolution: {integrity: sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==} + + micromark-util-normalize-identifier@1.1.0: + resolution: {integrity: sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==} + + micromark-util-resolve-all@1.1.0: + resolution: {integrity: sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==} + + micromark-util-sanitize-uri@1.2.0: + resolution: {integrity: sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==} + + micromark-util-subtokenize@1.1.0: + resolution: {integrity: sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==} + + micromark-util-symbol@1.1.0: + resolution: {integrity: sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==} + + micromark-util-types@1.1.0: + resolution: {integrity: sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==} + + micromark@3.2.0: + resolution: {integrity: sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==} + micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -2734,6 +3005,10 @@ packages: engines: {node: '>=10'} hasBin: true + mri@1.2.0: + resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} + engines: {node: '>=4'} + ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -3185,6 +3460,10 @@ packages: postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + postcss@8.4.38: + resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} + engines: {node: ^10 || ^12 || >=14} + postcss@8.4.47: resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} engines: {node: ^10 || ^12 || >=14} @@ -3223,10 +3502,16 @@ packages: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} + prop-types@15.8.1: + resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + propagate@2.0.1: resolution: {integrity: sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==} engines: {node: '>= 8'} + property-information@6.5.0: + resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} + proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} @@ -3267,12 +3552,30 @@ packages: final-form: ^4.20.4 react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-intersection-observer@9.13.1: + resolution: {integrity: sha512-tSzDaTy0qwNPLJHg8XZhlyHTgGW6drFKTtvjdL+p6um12rcnp8Z5XstE+QNBJ7c64n5o0Lj4ilUleA41bmDoMw==} + peerDependencies: + react: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + react-dom: + optional: true + + react-is@16.13.1: + resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} + react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + react-markdown@8.0.7: + resolution: {integrity: sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==} + peerDependencies: + '@types/react': '>=16' + react: '>=16' + react-router-dom@6.27.0: resolution: {integrity: sha512-+bvtFWMC0DgAFrfKXKG9Fc+BcXWRUO1aJIihbB79xaeq0v5UzfvnM5houGUm1Y461WVRcgAQ+Clh5rdb1eCx4g==} engines: {node: '>=14.0.0'} @@ -3326,6 +3629,12 @@ packages: resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==} engines: {node: '>= 0.10'} + remark-parse@10.0.2: + resolution: {integrity: sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==} + + remark-rehype@10.1.0: + resolution: {integrity: sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==} + renderkid@3.0.0: resolution: {integrity: sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==} @@ -3402,6 +3711,10 @@ packages: rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} + sade@1.8.1: + resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} + engines: {node: '>=6'} + safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -3463,6 +3776,9 @@ packages: resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} engines: {node: '>=8'} + shallowequal@1.1.0: + resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} + shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -3530,6 +3846,9 @@ packages: resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} engines: {node: '>= 8'} + space-separated-tokens@2.0.2: + resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} + sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} @@ -3586,12 +3905,28 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + style-to-object@0.4.4: + resolution: {integrity: sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg==} + + styled-components@6.1.13: + resolution: {integrity: sha512-M0+N2xSnAtwcVAQeFEsGWFFxXDftHUD7XrKla06QbpUMmbmtFBMMTcKWvFXtWxuD5qQkB8iU5gk6QASlx2ZRMw==} + engines: {node: '>= 16'} + peerDependencies: + react: '>= 16.8.0' + react-dom: '>= 16.8.0' + + styled-system@5.1.5: + resolution: {integrity: sha512-7VoD0o2R3RKzOzPK0jYrVnS8iJdfkKsQJNiLRDjikOpQVqQHns/DXWaPZOH4tIKkhAT7I6wIsy9FWTWh2X3q+A==} + stylehacks@7.0.4: resolution: {integrity: sha512-i4zfNrGMt9SB4xRK9L83rlsFCgdGANfeDAYacO1pkqcE7cRHPdWHwnKZVz7WY17Veq/FvyYsRAU++Ga+qDFIww==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: postcss: ^8.4.31 + stylis@4.3.2: + resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} + sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} engines: {node: '>=16 || 14 >=14.17'} @@ -3628,8 +3963,8 @@ packages: tailwind-merge@2.5.4: resolution: {integrity: sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==} - tailwindcss@3.4.13: - resolution: {integrity: sha512-KqjHOJKogOUt5Bs752ykCeiwvi0fKVkr5oqsFNt/8px/tA8scFPIlkygsf6jXrfCqGHz7VflA6+yytWuM+XhFw==} + tailwindcss@3.4.14: + resolution: {integrity: sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA==} engines: {node: '>=14.0.0'} hasBin: true @@ -3713,6 +4048,12 @@ packages: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true + trim-lines@3.0.1: + resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} + + trough@2.2.0: + resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} + truncate-utf8-bytes@1.0.2: resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==} @@ -3791,6 +4132,9 @@ packages: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} + unified@10.1.2: + resolution: {integrity: sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==} + unique-filename@2.0.1: resolution: {integrity: sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -3799,6 +4143,24 @@ packages: resolution: {integrity: sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + unist-util-generated@2.0.1: + resolution: {integrity: sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==} + + unist-util-is@5.2.1: + resolution: {integrity: sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==} + + unist-util-position@4.0.4: + resolution: {integrity: sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==} + + unist-util-stringify-position@3.0.3: + resolution: {integrity: sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==} + + unist-util-visit-parents@5.1.3: + resolution: {integrity: sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==} + + unist-util-visit@4.1.2: + resolution: {integrity: sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==} + universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -3835,6 +4197,11 @@ packages: utila@0.4.0: resolution: {integrity: sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==} + uvu@0.5.6: + resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} + engines: {node: '>=8'} + hasBin: true + v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} @@ -3846,6 +4213,12 @@ packages: resolution: {integrity: sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==} engines: {node: '>=0.6.0'} + vfile-message@3.1.4: + resolution: {integrity: sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==} + + vfile@5.3.7: + resolution: {integrity: sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==} + w3c-xmlserializer@4.0.0: resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} engines: {node: '>=14'} @@ -4376,8 +4749,26 @@ snapshots: transitivePeerDependencies: - supports-color + '@emotion/is-prop-valid@1.2.2': + dependencies: + '@emotion/memoize': 0.8.1 + + '@emotion/memoize@0.8.1': {} + + '@emotion/unitless@0.8.1': {} + '@gar/promisify@1.1.3': {} + '@github/combobox-nav@2.3.1': {} + + '@github/markdown-toolbar-element@2.2.3': {} + + '@github/paste-markdown@1.5.3': {} + + '@github/relative-time-element@4.4.3': {} + + '@github/tab-container-element@4.8.2': {} + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -4586,6 +4977,10 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.4.15 + '@lit-labs/react@1.2.1': {} + + '@lit-labs/ssr-dom-shim@1.2.1': {} + '@malept/cross-spawn-promise@1.1.1': dependencies: cross-spawn: 7.0.3 @@ -4625,13 +5020,68 @@ snapshots: mkdirp: 1.0.4 rimraf: 3.0.2 + '@oddbird/popover-polyfill@0.3.8': {} + '@pkgjs/parseargs@0.11.0': optional: true + '@primer/behaviors@1.7.2': {} + + '@primer/live-region-element@0.7.1': + dependencies: + '@lit-labs/ssr-dom-shim': 1.2.1 + + '@primer/octicons-react@19.11.0(react@18.3.1)': + dependencies: + react: 18.3.1 + '@primer/octicons-react@19.12.0(react@18.3.1)': dependencies: react: 18.3.1 + '@primer/primitives@7.17.1': {} + + '@primer/react@36.27.0(@types/react-dom@18.2.22)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': + dependencies: + '@github/combobox-nav': 2.3.1 + '@github/markdown-toolbar-element': 2.2.3 + '@github/paste-markdown': 1.5.3 + '@github/relative-time-element': 4.4.3 + '@github/tab-container-element': 4.8.2 + '@lit-labs/react': 1.2.1 + '@oddbird/popover-polyfill': 0.3.8 + '@primer/behaviors': 1.7.2 + '@primer/live-region-element': 0.7.1 + '@primer/octicons-react': 19.11.0(react@18.3.1) + '@primer/primitives': 7.17.1 + '@styled-system/css': 5.1.5 + '@styled-system/props': 5.1.5 + '@styled-system/theme-get': 5.1.2 + '@types/react-is': 18.3.0 + '@types/styled-system': 5.1.22 + '@types/styled-system__css': 5.0.21 + '@types/styled-system__theme-get': 5.0.4 + clsx: 1.2.1 + color2k: 2.0.3 + deepmerge: 4.3.1 + focus-visible: 5.2.1 + fzy.js: 0.4.1 + history: 5.3.0 + lodash.isempty: 4.4.0 + lodash.isobject: 3.0.2 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-intersection-observer: 9.13.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-is: 18.2.0 + react-markdown: 8.0.7(@types/react@18.3.11)(react@18.3.1) + styled-components: 6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + styled-system: 5.1.5 + optionalDependencies: + '@types/react': 18.3.11 + '@types/react-dom': 18.2.22 + transitivePeerDependencies: + - supports-color + '@remix-run/router@1.20.0': {} '@sinclair/typebox@0.27.8': {} @@ -4648,6 +5098,65 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.1 + '@styled-system/background@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/border@5.1.5': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/color@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/core@5.1.2': + dependencies: + object-assign: 4.1.1 + + '@styled-system/css@5.1.5': {} + + '@styled-system/flexbox@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/grid@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/layout@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/position@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/props@5.1.5': + dependencies: + styled-system: 5.1.5 + + '@styled-system/shadow@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/space@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/theme-get@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/typography@5.1.2': + dependencies: + '@styled-system/core': 5.1.2 + + '@styled-system/variant@5.1.5': + dependencies: + '@styled-system/core': 5.1.2 + '@styled-system/css': 5.1.5 + '@szmarczak/http-timer@4.0.6': dependencies: defer-to-connect: 2.0.1 @@ -4731,6 +5240,10 @@ snapshots: dependencies: '@types/node': 20.16.11 + '@types/hast@2.3.10': + dependencies: + '@types/unist': 2.0.11 + '@types/history@4.7.11': {} '@types/html-minifier-terser@6.1.0': {} @@ -4764,6 +5277,10 @@ snapshots: dependencies: '@types/node': 20.16.11 + '@types/mdast@3.0.15': + dependencies: + '@types/unist': 2.0.11 + '@types/ms@0.7.34': {} '@types/node@20.16.11': @@ -4785,6 +5302,10 @@ snapshots: '@types/react': 18.3.11 optional: true + '@types/react-is@18.3.0': + dependencies: + '@types/react': 18.3.11 + '@types/react-router-dom@5.3.3': dependencies: '@types/history': 4.7.11 @@ -4807,8 +5328,22 @@ snapshots: '@types/stack-utils@2.0.3': {} + '@types/styled-system@5.1.22': + dependencies: + csstype: 3.1.3 + + '@types/styled-system__css@5.0.21': + dependencies: + csstype: 3.1.3 + + '@types/styled-system__theme-get@5.0.4': {} + + '@types/stylis@4.2.5': {} + '@types/tough-cookie@4.0.5': {} + '@types/unist@2.0.11': {} + '@types/verror@1.10.10': optional: true @@ -5231,6 +5766,8 @@ snapshots: babel-plugin-jest-hoist: 29.6.3 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.3) + bail@2.0.2: {} + balanced-match@1.0.2: {} base64-js@1.5.1: {} @@ -5397,6 +5934,8 @@ snapshots: camelcase@6.3.0: {} + camelize@1.0.1: {} + caniuse-api@3.0.0: dependencies: browserslist: 4.23.3 @@ -5419,6 +5958,8 @@ snapshots: char-regex@1.0.2: {} + character-entities@2.0.2: {} + chokidar@3.6.0: dependencies: anymatch: 3.1.3 @@ -5441,10 +5982,6 @@ snapshots: cjs-module-lexer@1.2.3: {} - class-variance-authority@0.7.0: - dependencies: - clsx: 2.0.0 - clean-css@5.3.3: dependencies: source-map: 0.6.1 @@ -5481,7 +6018,7 @@ snapshots: clone@1.0.4: {} - clsx@2.0.0: {} + clsx@1.2.1: {} clsx@2.1.1: {} @@ -5503,6 +6040,8 @@ snapshots: color-support@1.1.3: {} + color2k@2.0.3: {} + colord@2.9.3: {} colorette@2.0.20: {} @@ -5511,6 +6050,8 @@ snapshots: dependencies: delayed-stream: 1.0.0 + comma-separated-tokens@2.0.3: {} + commander@10.0.1: {} commander@2.20.3: {} @@ -5617,6 +6158,8 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 + css-color-keywords@1.0.0: {} + css-declaration-sorter@7.2.0(postcss@8.4.47): dependencies: postcss: 8.4.47 @@ -5660,6 +6203,12 @@ snapshots: domutils: 3.1.0 nth-check: 2.1.1 + css-to-react-native@3.2.0: + dependencies: + camelize: 1.0.1 + css-color-keywords: 1.0.0 + postcss-value-parser: 4.2.0 + css-tree@2.2.1: dependencies: mdn-data: 2.0.28 @@ -5746,6 +6295,10 @@ snapshots: decimal.js@10.4.3: {} + decode-named-character-reference@1.0.2: + dependencies: + character-entities: 2.0.2 + decompress-response@6.0.0: dependencies: mimic-response: 3.1.0 @@ -5793,6 +6346,8 @@ snapshots: diff@4.0.2: {} + diff@5.2.0: {} + dir-compare@3.3.0: dependencies: buffer-equal: 1.0.1 @@ -6087,6 +6642,8 @@ snapshots: exponential-backoff@3.1.1: {} + extend@3.0.2: {} + extract-zip@2.0.1: dependencies: debug: 4.3.4 @@ -6147,6 +6704,8 @@ snapshots: flat@5.0.2: {} + focus-visible@5.2.1: {} + follow-redirects@1.15.6: {} foreground-child@3.1.1: @@ -6200,6 +6759,8 @@ snapshots: function-bind@1.1.2: {} + fzy.js@0.4.1: {} + gauge@4.0.4: dependencies: aproba: 2.0.0 @@ -6356,8 +6917,14 @@ snapshots: dependencies: function-bind: 1.1.2 + hast-util-whitespace@2.0.1: {} + he@1.2.0: {} + history@5.3.0: + dependencies: + '@babel/runtime': 7.24.1 + hosted-git-info@4.1.0: dependencies: lru-cache: 6.0.0 @@ -6480,6 +7047,8 @@ snapshots: inherits@2.0.4: {} + inline-style-parser@0.1.1: {} + interpret@3.1.1: {} ip-address@9.0.5: @@ -6493,6 +7062,8 @@ snapshots: dependencies: binary-extensions: 2.3.0 + is-buffer@2.0.5: {} + is-ci@3.0.1: dependencies: ci-info: 3.9.0 @@ -6517,6 +7088,8 @@ snapshots: is-number@7.0.0: {} + is-plain-obj@4.1.0: {} + is-plain-object@2.0.4: dependencies: isobject: 3.0.1 @@ -7015,6 +7588,8 @@ snapshots: kleur@3.0.3: {} + kleur@4.1.5: {} + lazy-val@1.0.5: {} lazystream@1.0.1: @@ -7025,8 +7600,6 @@ snapshots: lilconfig@2.1.0: {} - lilconfig@3.1.1: {} - lilconfig@3.1.2: {} lines-and-columns@1.2.4: {} @@ -7045,8 +7618,12 @@ snapshots: lodash.flatten@4.4.0: {} + lodash.isempty@4.4.0: {} + lodash.isequal@4.5.0: {} + lodash.isobject@3.0.2: {} + lodash.isplainobject@4.0.6: {} lodash.memoize@4.1.2: {} @@ -7125,6 +7702,44 @@ snapshots: escape-string-regexp: 4.0.0 optional: true + mdast-util-definitions@5.1.2: + dependencies: + '@types/mdast': 3.0.15 + '@types/unist': 2.0.11 + unist-util-visit: 4.1.2 + + mdast-util-from-markdown@1.3.1: + dependencies: + '@types/mdast': 3.0.15 + '@types/unist': 2.0.11 + decode-named-character-reference: 1.0.2 + mdast-util-to-string: 3.2.0 + micromark: 3.2.0 + micromark-util-decode-numeric-character-reference: 1.1.0 + micromark-util-decode-string: 1.1.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + unist-util-stringify-position: 3.0.3 + uvu: 0.5.6 + transitivePeerDependencies: + - supports-color + + mdast-util-to-hast@12.3.0: + dependencies: + '@types/hast': 2.3.10 + '@types/mdast': 3.0.15 + mdast-util-definitions: 5.1.2 + micromark-util-sanitize-uri: 1.2.0 + trim-lines: 3.0.1 + unist-util-generated: 2.0.1 + unist-util-position: 4.0.4 + unist-util-visit: 4.1.2 + + mdast-util-to-string@3.2.0: + dependencies: + '@types/mdast': 3.0.15 + mdn-data@2.0.28: {} mdn-data@2.0.30: {} @@ -7138,6 +7753,139 @@ snapshots: merge2@1.4.1: {} + micromark-core-commonmark@1.1.0: + dependencies: + decode-named-character-reference: 1.0.2 + micromark-factory-destination: 1.1.0 + micromark-factory-label: 1.1.0 + micromark-factory-space: 1.1.0 + micromark-factory-title: 1.1.0 + micromark-factory-whitespace: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-chunked: 1.1.0 + micromark-util-classify-character: 1.1.0 + micromark-util-html-tag-name: 1.2.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-resolve-all: 1.1.0 + micromark-util-subtokenize: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + + micromark-factory-destination@1.1.0: + dependencies: + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + + micromark-factory-label@1.1.0: + dependencies: + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + + micromark-factory-space@1.1.0: + dependencies: + micromark-util-character: 1.2.0 + micromark-util-types: 1.1.0 + + micromark-factory-title@1.1.0: + dependencies: + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + + micromark-factory-whitespace@1.1.0: + dependencies: + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + + micromark-util-character@1.2.0: + dependencies: + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + + micromark-util-chunked@1.1.0: + dependencies: + micromark-util-symbol: 1.1.0 + + micromark-util-classify-character@1.1.0: + dependencies: + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + + micromark-util-combine-extensions@1.1.0: + dependencies: + micromark-util-chunked: 1.1.0 + micromark-util-types: 1.1.0 + + micromark-util-decode-numeric-character-reference@1.1.0: + dependencies: + micromark-util-symbol: 1.1.0 + + micromark-util-decode-string@1.1.0: + dependencies: + decode-named-character-reference: 1.0.2 + micromark-util-character: 1.2.0 + micromark-util-decode-numeric-character-reference: 1.1.0 + micromark-util-symbol: 1.1.0 + + micromark-util-encode@1.1.0: {} + + micromark-util-html-tag-name@1.2.0: {} + + micromark-util-normalize-identifier@1.1.0: + dependencies: + micromark-util-symbol: 1.1.0 + + micromark-util-resolve-all@1.1.0: + dependencies: + micromark-util-types: 1.1.0 + + micromark-util-sanitize-uri@1.2.0: + dependencies: + micromark-util-character: 1.2.0 + micromark-util-encode: 1.1.0 + micromark-util-symbol: 1.1.0 + + micromark-util-subtokenize@1.1.0: + dependencies: + micromark-util-chunked: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + + micromark-util-symbol@1.1.0: {} + + micromark-util-types@1.1.0: {} + + micromark@3.2.0: + dependencies: + '@types/debug': 4.1.12 + debug: 4.3.4 + decode-named-character-reference: 1.0.2 + micromark-core-commonmark: 1.1.0 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-chunked: 1.1.0 + micromark-util-combine-extensions: 1.1.0 + micromark-util-decode-numeric-character-reference: 1.1.0 + micromark-util-encode: 1.1.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-resolve-all: 1.1.0 + micromark-util-sanitize-uri: 1.2.0 + micromark-util-subtokenize: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + transitivePeerDependencies: + - supports-color + micromatch@4.0.5: dependencies: braces: 3.0.2 @@ -7220,6 +7968,8 @@ snapshots: mkdirp@1.0.4: {} + mri@1.2.0: {} + ms@2.1.2: {} mz@2.7.0: @@ -7479,7 +8229,7 @@ snapshots: postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)): dependencies: - lilconfig: 3.1.1 + lilconfig: 3.1.2 yaml: 2.4.1 optionalDependencies: postcss: 8.4.47 @@ -7559,7 +8309,7 @@ snapshots: postcss-nested@6.0.1(postcss@8.4.47): dependencies: postcss: 8.4.47 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.2 postcss-normalize-charset@7.0.0(postcss@8.4.47): dependencies: @@ -7646,6 +8396,12 @@ snapshots: postcss-value-parser@4.2.0: {} + postcss@8.4.38: + dependencies: + nanoid: 3.3.7 + picocolors: 1.1.0 + source-map-js: 1.2.1 + postcss@8.4.47: dependencies: nanoid: 3.3.7 @@ -7685,8 +8441,16 @@ snapshots: kleur: 3.0.3 sisteransi: 1.0.5 + prop-types@15.8.1: + dependencies: + loose-envify: 1.4.0 + object-assign: 4.1.1 + react-is: 16.13.1 + propagate@2.0.1: {} + property-information@6.5.0: {} + proxy-from-env@1.1.0: {} psl@1.9.0: {} @@ -7722,10 +8486,40 @@ snapshots: final-form: 4.20.10 react: 18.3.1 + react-intersection-observer@9.13.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + react: 18.3.1 + optionalDependencies: + react-dom: 18.3.1(react@18.3.1) + + react-is@16.13.1: {} + react-is@17.0.2: {} react-is@18.2.0: {} + react-markdown@8.0.7(@types/react@18.3.11)(react@18.3.1): + dependencies: + '@types/hast': 2.3.10 + '@types/prop-types': 15.7.12 + '@types/react': 18.3.11 + '@types/unist': 2.0.11 + comma-separated-tokens: 2.0.3 + hast-util-whitespace: 2.0.1 + prop-types: 15.8.1 + property-information: 6.5.0 + react: 18.3.1 + react-is: 18.2.0 + remark-parse: 10.0.2 + remark-rehype: 10.1.0 + space-separated-tokens: 2.0.2 + style-to-object: 0.4.4 + unified: 10.1.2 + unist-util-visit: 4.1.2 + vfile: 5.3.7 + transitivePeerDependencies: + - supports-color + react-router-dom@6.27.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@remix-run/router': 1.20.0 @@ -7793,6 +8587,21 @@ snapshots: relateurl@0.2.7: {} + remark-parse@10.0.2: + dependencies: + '@types/mdast': 3.0.15 + mdast-util-from-markdown: 1.3.1 + unified: 10.1.2 + transitivePeerDependencies: + - supports-color + + remark-rehype@10.1.0: + dependencies: + '@types/hast': 2.3.10 + '@types/mdast': 3.0.15 + mdast-util-to-hast: 12.3.0 + unified: 10.1.2 + renderkid@3.0.0: dependencies: css-select: 4.3.0 @@ -7869,6 +8678,10 @@ snapshots: dependencies: tslib: 2.6.2 + sade@1.8.1: + dependencies: + mri: 1.2.0 + safe-buffer@5.1.2: {} safe-buffer@5.2.1: {} @@ -7928,6 +8741,8 @@ snapshots: dependencies: kind-of: 6.0.3 + shallowequal@1.1.0: {} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 @@ -7988,6 +8803,8 @@ snapshots: source-map@0.7.4: {} + space-separated-tokens@2.0.2: {} + sprintf-js@1.0.3: {} sprintf-js@1.1.3: {} @@ -8041,12 +8858,48 @@ snapshots: strip-json-comments@3.1.1: {} + style-to-object@0.4.4: + dependencies: + inline-style-parser: 0.1.1 + + styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + '@emotion/is-prop-valid': 1.2.2 + '@emotion/unitless': 0.8.1 + '@types/stylis': 4.2.5 + css-to-react-native: 3.2.0 + csstype: 3.1.3 + postcss: 8.4.38 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + shallowequal: 1.1.0 + stylis: 4.3.2 + tslib: 2.6.2 + + styled-system@5.1.5: + dependencies: + '@styled-system/background': 5.1.2 + '@styled-system/border': 5.1.5 + '@styled-system/color': 5.1.2 + '@styled-system/core': 5.1.2 + '@styled-system/flexbox': 5.1.2 + '@styled-system/grid': 5.1.2 + '@styled-system/layout': 5.1.2 + '@styled-system/position': 5.1.2 + '@styled-system/shadow': 5.1.2 + '@styled-system/space': 5.1.2 + '@styled-system/typography': 5.1.2 + '@styled-system/variant': 5.1.5 + object-assign: 4.1.1 + stylehacks@7.0.4(postcss@8.4.47): dependencies: browserslist: 4.23.3 postcss: 8.4.47 postcss-selector-parser: 6.1.2 + stylis@4.3.2: {} + sucrase@3.35.0: dependencies: '@jridgewell/gen-mapping': 0.3.5 @@ -8091,7 +8944,7 @@ snapshots: tailwind-merge@2.5.4: {} - tailwindcss@3.4.13(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)): + tailwindcss@3.4.14(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -8112,7 +8965,7 @@ snapshots: postcss-js: 4.0.1(postcss@8.4.47) postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)) postcss-nested: 6.0.1(postcss@8.4.47) - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.2 resolve: 1.22.8 sucrase: 3.35.0 transitivePeerDependencies: @@ -8201,6 +9054,10 @@ snapshots: tree-kill@1.2.2: {} + trim-lines@3.0.1: {} + + trough@2.2.0: {} + truncate-utf8-bytes@1.0.2: dependencies: utf8-byte-length: 1.0.4 @@ -8269,6 +9126,16 @@ snapshots: unicorn-magic@0.1.0: {} + unified@10.1.2: + dependencies: + '@types/unist': 2.0.11 + bail: 2.0.2 + extend: 3.0.2 + is-buffer: 2.0.5 + is-plain-obj: 4.1.0 + trough: 2.2.0 + vfile: 5.3.7 + unique-filename@2.0.1: dependencies: unique-slug: 3.0.0 @@ -8277,6 +9144,31 @@ snapshots: dependencies: imurmurhash: 0.1.4 + unist-util-generated@2.0.1: {} + + unist-util-is@5.2.1: + dependencies: + '@types/unist': 2.0.11 + + unist-util-position@4.0.4: + dependencies: + '@types/unist': 2.0.11 + + unist-util-stringify-position@3.0.3: + dependencies: + '@types/unist': 2.0.11 + + unist-util-visit-parents@5.1.3: + dependencies: + '@types/unist': 2.0.11 + unist-util-is: 5.2.1 + + unist-util-visit@4.1.2: + dependencies: + '@types/unist': 2.0.11 + unist-util-is: 5.2.1 + unist-util-visit-parents: 5.1.3 + universalify@0.1.2: {} universalify@0.2.0: {} @@ -8310,6 +9202,13 @@ snapshots: utila@0.4.0: {} + uvu@0.5.6: + dependencies: + dequal: 2.0.3 + diff: 5.2.0 + kleur: 4.1.5 + sade: 1.8.1 + v8-compile-cache-lib@3.0.1: {} v8-to-istanbul@9.2.0: @@ -8325,6 +9224,18 @@ snapshots: extsprintf: 1.4.1 optional: true + vfile-message@3.1.4: + dependencies: + '@types/unist': 2.0.11 + unist-util-stringify-position: 3.0.3 + + vfile@5.3.7: + dependencies: + '@types/unist': 2.0.11 + is-buffer: 2.0.5 + unist-util-stringify-position: 3.0.3 + vfile-message: 3.1.4 + w3c-xmlserializer@4.0.0: dependencies: xml-name-validator: 4.0.0 diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 86a47b86d..921c05344 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -6,6 +6,9 @@ import { Routes, useLocation, } from 'react-router-dom'; + +import { BaseStyles, ThemeProvider } from '@primer/react'; + import { Loading } from './components/Loading'; import { Sidebar } from './components/Sidebar'; import { AppContext, AppProvider } from './context/App'; @@ -16,6 +19,7 @@ import { LoginWithOAuthAppRoute } from './routes/LoginWithOAuthApp'; import { LoginWithPersonalAccessTokenRoute } from './routes/LoginWithPersonalAccessToken'; import { NotificationsRoute } from './routes/Notifications'; import { SettingsRoute } from './routes/Settings'; + import './App.css'; function RequireAuth({ children }) { @@ -31,56 +35,60 @@ function RequireAuth({ children }) { export const App = () => { return ( - - -
- - - - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - } /> - } - /> - } - /> - -
-
-
+ + + + +
+ + + + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + /> + } /> + } + /> + } + /> + +
+
+
+
+
); }; diff --git a/src/renderer/__helpers__/setupPrimerJest.js b/src/renderer/__helpers__/setupPrimerJest.js new file mode 100644 index 000000000..83cafa072 --- /dev/null +++ b/src/renderer/__helpers__/setupPrimerJest.js @@ -0,0 +1,13 @@ +if (typeof CSS === 'undefined') { + global.CSS = {}; +} + +if (!CSS.supports) { + CSS.supports = () => true; +} + +global.ResizeObserver = class { + observe() {} + unobserve() {} + disconnect() {} +}; diff --git a/src/renderer/components/AllRead.test.tsx b/src/renderer/components/AllRead.test.tsx index a818c607e..23afec8c1 100644 --- a/src/renderer/components/AllRead.test.tsx +++ b/src/renderer/components/AllRead.test.tsx @@ -1,5 +1,8 @@ import { render } from '@testing-library/react'; +import { MemoryRouter } from 'react-router-dom'; +import { mockSettings } from '../__mocks__/state-mocks'; import { ensureStableEmojis } from '../__mocks__/utils'; +import { AppContext } from '../context/App'; import { AllRead } from './AllRead'; describe('renderer/components/AllRead.tsx', () => { @@ -7,8 +10,40 @@ describe('renderer/components/AllRead.tsx', () => { ensureStableEmojis(); }); - it('should render itself & its children', () => { - const tree = render(); + it('should render itself & its children - no filters', () => { + const tree = render( + + + + + , + ); + + expect(tree).toMatchSnapshot(); + }); + + it('should render itself & its children - with filters', () => { + const tree = render( + + + + + , + ); expect(tree).toMatchSnapshot(); }); diff --git a/src/renderer/components/AllRead.tsx b/src/renderer/components/AllRead.tsx index 206c31c43..37b08c7db 100644 --- a/src/renderer/components/AllRead.tsx +++ b/src/renderer/components/AllRead.tsx @@ -1,8 +1,18 @@ -import { type FC, useMemo } from 'react'; +import { type FC, useContext, useMemo } from 'react'; + +import { Stack } from '@primer/react'; + +import { AppContext } from '../context/App'; import { Constants } from '../utils/constants'; -import { EmojiText } from './EmojiText'; +import { hasFiltersSet } from '../utils/filters'; +import { Centered } from './primitives/Centered'; +import { EmojiText } from './primitives/EmojiText'; export const AllRead: FC = () => { + const { settings } = useContext(AppContext); + + const hasFilters = hasFiltersSet(settings); + const emoji = useMemo( () => Constants.ALL_READ_EMOJIS[ @@ -12,12 +22,20 @@ export const AllRead: FC = () => { ); return ( -
-
- -
+ + +
+ +
-
No new notifications.
-
+ {hasFilters ? ( +
+ No new filtered notifications +
+ ) : ( +
No new notifications
+ )} + + ); }; diff --git a/src/renderer/components/Header.tsx b/src/renderer/components/Header.tsx deleted file mode 100644 index 3ecddb9e4..000000000 --- a/src/renderer/components/Header.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { ArrowLeftIcon, type Icon } from '@primer/octicons-react'; -import { type FC, useContext } from 'react'; -import { useNavigate } from 'react-router-dom'; -import { AppContext } from '../context/App'; -import { Size } from '../types'; -import { Legend } from './settings/Legend'; - -interface IHeader { - icon: Icon; - children: string; - fetchOnBack?: boolean; -} - -export const Header: FC = (props: IHeader) => { - const navigate = useNavigate(); - - const { fetchNotifications } = useContext(AppContext); - - return ( -
- - -

- {props.children} -

-
- ); -}; diff --git a/src/renderer/components/HoverGroup.tsx b/src/renderer/components/HoverGroup.tsx deleted file mode 100644 index 0d238d381..000000000 --- a/src/renderer/components/HoverGroup.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import type { FC, ReactNode } from 'react'; - -interface IHoverGroup { - children: ReactNode; -} - -export const HoverGroup: FC = ({ children }: IHoverGroup) => { - return ( -
- {children} -
- ); -}; diff --git a/src/renderer/components/Loading.tsx b/src/renderer/components/Loading.tsx index e008c7fa1..882f085be 100644 --- a/src/renderer/components/Loading.tsx +++ b/src/renderer/components/Loading.tsx @@ -1,5 +1,7 @@ -import NProgress from 'nprogress'; import { type FC, useContext, useEffect } from 'react'; + +import NProgress from 'nprogress'; + import { AppContext } from '../context/App'; export const Loading: FC = () => { diff --git a/src/renderer/components/Oops.tsx b/src/renderer/components/Oops.tsx index 8161eff65..ad543cecd 100644 --- a/src/renderer/components/Oops.tsx +++ b/src/renderer/components/Oops.tsx @@ -1,6 +1,9 @@ import { type FC, useMemo } from 'react'; + +import { Stack } from '@primer/react'; import type { GitifyError } from '../types'; -import { EmojiText } from './EmojiText'; +import { Centered } from './primitives/Centered'; +import { EmojiText } from './primitives/EmojiText'; interface IOops { error: GitifyError; @@ -13,20 +16,22 @@ export const Oops: FC = ({ error }: IOops) => { ); return ( -
-
- -
+ + +
+ +
-
{error.title}
- {error.descriptions.map((description, i) => { - return ( - // biome-ignore lint/suspicious/noArrayIndexKey: using index for key to keep the error constants clean -
- {description} -
- ); - })} -
+
{error.title}
+ {error.descriptions.map((description, i) => { + return ( + // biome-ignore lint/suspicious/noArrayIndexKey: using index for key to keep the error constants clean +
+ {description} +
+ ); + })} + + ); }; diff --git a/src/renderer/components/Sidebar.test.tsx b/src/renderer/components/Sidebar.test.tsx index c3960d25f..cb80eb6e1 100644 --- a/src/renderer/components/Sidebar.test.tsx +++ b/src/renderer/components/Sidebar.test.tsx @@ -3,7 +3,6 @@ import { MemoryRouter } from 'react-router-dom'; import { mockAccountNotifications } from '../__mocks__/notifications-mocks'; import { mockAuth, mockSettings } from '../__mocks__/state-mocks'; import { AppContext } from '../context/App'; -import { IconColor } from '../types'; import * as comms from '../utils/comms'; import { Sidebar } from './Sidebar'; @@ -76,125 +75,36 @@ describe('renderer/components/Sidebar.tsx', () => { , ); - fireEvent.click(screen.getByTitle('Home')); + fireEvent.click(screen.getByTestId('sidebar-home')); expect(mockNavigate).toHaveBeenNthCalledWith(1, '/', { replace: true }); }); - describe('quick links', () => { - describe('notifications icon', () => { - it('when there are 0 notifications', () => { - render( - - - - - , - ); - - const notificationsIcon = screen.getByTitle('0 unread notifications'); - - expect(notificationsIcon.className).toContain('text-white'); - expect(notificationsIcon.childNodes.length).toBe(1); - expect(notificationsIcon.childNodes[0].nodeName).toBe('svg'); - - fireEvent.click(screen.getByLabelText('0 unread notifications')); - - expect(openExternalLinkMock).toHaveBeenCalledTimes(1); - expect(openExternalLinkMock).toHaveBeenCalledWith( - 'https://github.com/notifications', - ); - }); - - it('when there are more than 0 notifications', () => { - render( - - - - - , - ); - - const notificationsIcon = screen.getByTitle('4 unread notifications'); - - expect(notificationsIcon.className).toContain(IconColor.GREEN); - expect(notificationsIcon.childNodes.length).toBe(2); - expect(notificationsIcon.childNodes[0].nodeName).toBe('svg'); - expect(notificationsIcon.childNodes[1].nodeValue).toBe('4'); - - fireEvent.click(screen.getByLabelText('4 unread notifications')); - - expect(openExternalLinkMock).toHaveBeenCalledTimes(1); - expect(openExternalLinkMock).toHaveBeenCalledWith( - 'https://github.com/notifications', - ); - }); - }); - }); - - it('opens my github issues page', () => { - render( - - - - - , - ); - - fireEvent.click(screen.getByLabelText('My issues')); - - expect(openExternalLinkMock).toHaveBeenCalledTimes(1); - expect(openExternalLinkMock).toHaveBeenCalledWith( - 'https://github.com/issues', - ); - }); - - it('opens my github pull requests page', () => { - render( - - - - - , - ); + describe('notifications icon', () => { + it('opens notifications home when clicked', () => { + render( + + + + + , + ); - fireEvent.click(screen.getByLabelText('My pull requests')); + fireEvent.click(screen.getByTestId('sidebar-notifications')); - expect(openExternalLinkMock).toHaveBeenCalledTimes(1); - expect(openExternalLinkMock).toHaveBeenCalledWith( - 'https://github.com/pulls', - ); - }); + expect(openExternalLinkMock).toHaveBeenCalledTimes(1); + expect(openExternalLinkMock).toHaveBeenCalledWith( + 'https://github.com/notifications', + ); + }); - describe('Refresh Notifications', () => { - it('should refresh the notifications when status is not loading', () => { + it('renders correct icon when there are no notifications', () => { render( { notifications: [], auth: mockAuth, settings: mockSettings, - fetchNotifications, - status: 'success', }} > @@ -212,12 +120,10 @@ describe('renderer/components/Sidebar.tsx', () => { , ); - fireEvent.click(screen.getByTitle('Refresh notifications')); - - expect(fetchNotifications).toHaveBeenCalledTimes(1); + expect(screen.getByTestId('sidebar-notifications')).toMatchSnapshot(); }); - it('should not refresh the notifications when status is loading', () => { + it('renders correct icon when there are notifications', () => { render( { notifications: [], auth: mockAuth, settings: mockSettings, - fetchNotifications, - status: 'loading', }} > @@ -235,13 +139,11 @@ describe('renderer/components/Sidebar.tsx', () => { , ); - fireEvent.click(screen.getByTitle('Refresh notifications')); - - expect(fetchNotifications).not.toHaveBeenCalled(); + expect(screen.getByTestId('sidebar-notifications')).toMatchSnapshot(); }); }); - describe('Filters', () => { + describe('Filter notifications', () => { it('go to the filters route', () => { render( { , ); - fireEvent.click(screen.getByTitle('Filters')); + + fireEvent.click(screen.getByTestId('sidebar-filter-notifications')); + expect(mockNavigate).toHaveBeenNthCalledWith(1, '/filters'); }); @@ -276,18 +180,20 @@ describe('renderer/components/Sidebar.tsx', () => { , ); - fireEvent.click(screen.getByTitle('Filters')); + + fireEvent.click(screen.getByTestId('sidebar-filter-notifications')); + expect(mockNavigate).toHaveBeenNthCalledWith(1, '/', { replace: true }); }); }); - describe('Settings', () => { - it('go to the settings route', () => { + describe('quick links', () => { + it('opens my github issues page', () => { render( { , ); - fireEvent.click(screen.getByTitle('Settings')); + fireEvent.click(screen.getByTestId('sidebar-my-issues')); - expect(mockNavigate).toHaveBeenNthCalledWith(1, '/settings'); + expect(openExternalLinkMock).toHaveBeenCalledTimes(1); + expect(openExternalLinkMock).toHaveBeenCalledWith( + 'https://github.com/issues', + ); }); - it('go to the home if settings path already shown', () => { + it('opens my github pull requests page', () => { render( - + , ); - fireEvent.click(screen.getByTitle('Settings')); + fireEvent.click(screen.getByTestId('sidebar-my-pull-requests')); - expect(fetchNotifications).toHaveBeenCalledTimes(1); - expect(mockNavigate).toHaveBeenNthCalledWith(1, '/', { replace: true }); + expect(openExternalLinkMock).toHaveBeenCalledTimes(1); + expect(openExternalLinkMock).toHaveBeenCalledWith( + 'https://github.com/pulls', + ); }); }); - it('opens github in the notifications page', () => { - const openExternalLinkMock = jest.spyOn(comms, 'openExternalLink'); - - render( - - - - - , - ); - fireEvent.click(screen.getByLabelText('4 unread notifications')); - expect(openExternalLinkMock).toHaveBeenCalledTimes(1); - expect(openExternalLinkMock).toHaveBeenCalledWith( - 'https://github.com/notifications', - ); - }); - - it('opens my github issues page', () => { - const openExternalLinkMock = jest.spyOn(comms, 'openExternalLink'); - - render( - - - - - , - ); - fireEvent.click(screen.getByLabelText('My issues')); - expect(openExternalLinkMock).toHaveBeenCalledTimes(1); - expect(openExternalLinkMock).toHaveBeenCalledWith( - 'https://github.com/issues', - ); - }); - - it('opens my github pull requests page', () => { - const openExternalLinkMock = jest.spyOn(comms, 'openExternalLink'); + describe('Refresh Notifications', () => { + it('should refresh the notifications when status is not loading', () => { + render( + + + + + , + ); - render( - - - - - , - ); - fireEvent.click(screen.getByLabelText('My pull requests')); - expect(openExternalLinkMock).toHaveBeenCalledTimes(1); - expect(openExternalLinkMock).toHaveBeenCalledWith( - 'https://github.com/pulls', - ); - }); + fireEvent.click(screen.getByTestId('sidebar-refresh')); - it('should quit the app', () => { - const quitAppMock = jest.spyOn(comms, 'quitApp'); + expect(fetchNotifications).toHaveBeenCalledTimes(1); + }); - render( - - - - - , - ); + it('should not refresh the notifications when status is loading', () => { + render( + + + + + , + ); - fireEvent.click(screen.getByTitle('Quit Gitify')); + fireEvent.click(screen.getByTestId('sidebar-refresh')); - expect(quitAppMock).toHaveBeenCalledTimes(1); + expect(fetchNotifications).not.toHaveBeenCalled(); + }); }); - describe('should render the notifications icon', () => { - it('when there are 0 notifications', () => { + describe('Settings', () => { + it('go to the settings route', () => { render( { , ); - const notificationsIcon = screen.getByTitle('0 unread notifications'); - expect(notificationsIcon.className).toContain('text-white'); - expect(notificationsIcon.childNodes.length).toBe(1); - expect(notificationsIcon.childNodes[0].nodeName).toBe('svg'); + fireEvent.click(screen.getByTestId('sidebar-settings')); + + expect(mockNavigate).toHaveBeenNthCalledWith(1, '/settings'); }); - it('when there are more than 0 notifications', () => { + it('go to the home if settings path already shown', () => { render( - + , ); - const notificationsIcon = screen.getByTitle('4 unread notifications'); - expect(notificationsIcon.className).toContain(IconColor.GREEN); - expect(notificationsIcon.childNodes.length).toBe(2); - expect(notificationsIcon.childNodes[0].nodeName).toBe('svg'); - expect(notificationsIcon.childNodes[1].nodeValue).toBe('4'); + fireEvent.click(screen.getByTestId('sidebar-settings')); + + expect(fetchNotifications).toHaveBeenCalledTimes(1); + expect(mockNavigate).toHaveBeenNthCalledWith(1, '/', { replace: true }); }); }); + + it('should quit the app', () => { + const quitAppMock = jest.spyOn(comms, 'quitApp'); + + render( + + + + + , + ); + + fireEvent.click(screen.getByTestId('sidebar-quit')); + + expect(quitAppMock).toHaveBeenCalledTimes(1); + }); }); diff --git a/src/renderer/components/Sidebar.tsx b/src/renderer/components/Sidebar.tsx index bf28a0b30..cc3f04d72 100644 --- a/src/renderer/components/Sidebar.tsx +++ b/src/renderer/components/Sidebar.tsx @@ -1,3 +1,6 @@ +import { type FC, useContext, useMemo } from 'react'; +import { useLocation, useNavigate } from 'react-router-dom'; + import { BellIcon, FilterIcon, @@ -7,20 +10,18 @@ import { SyncIcon, XCircleIcon, } from '@primer/octicons-react'; -import { type FC, useContext, useMemo } from 'react'; -import { useLocation, useNavigate } from 'react-router-dom'; + +import { IconButton, Stack } from '@primer/react'; import { AppContext } from '../context/App'; -import { Size } from '../types'; import { quitApp } from '../utils/comms'; import { Constants } from '../utils/constants'; -import { getFilterCount } from '../utils/helpers'; +import { hasFiltersSet } from '../utils/filters'; import { openGitHubIssues, openGitHubNotifications, openGitHubPulls, } from '../utils/links'; import { getNotificationCount } from '../utils/notifications'; -import { SidebarButton } from './buttons/SidebarButton'; import { LogoIcon } from './icons/LogoIcon'; export const Sidebar: FC = () => { @@ -66,80 +67,133 @@ export const Sidebar: FC = () => { return getNotificationCount(notifications); }, [notifications]); - const filterCount = useMemo(() => { - return getFilterCount(settings); - }, [settings]); - return ( -
-
- - - openGitHubNotifications(primaryAccountHostname)} - /> - - openGitHubIssues(primaryAccountHostname)} - /> - - openGitHubPulls(primaryAccountHostname)} - /> + navigate('/', { replace: true })} + data-testid="sidebar-home" + /> + + 0 ? 'primary' : 'invisible'} + tooltipDirection="e" + onClick={() => openGitHubNotifications(primaryAccountHostname)} + data-testid="sidebar-notifications" + sx={{ color: 'white' }} + /> + + {/* TODO - explore https://primer.style/components/selectpanel/react/alpha/ for a better UI for filters */} + {isLoggedIn && ( + toggleFilters()} + data-testid="sidebar-filter-notifications" + sx={{ color: 'white' }} + /> + )} + + openGitHubIssues(primaryAccountHostname)} + data-testid="sidebar-my-issues" + sx={{ color: 'white' }} + /> + + openGitHubPulls(primaryAccountHostname)} + data-testid="sidebar-my-pull-requests" + sx={{ color: 'white' }} + /> +
-
+ {isLoggedIn && ( <> - refreshNotifications()} + data-testid="sidebar-refresh" + sx={{ color: 'white' }} /> - toggleFilters()} - /> - - toggleSettings()} + data-testid="sidebar-settings" + sx={{ color: 'white' }} /> )} {!isLoggedIn && ( - quitApp()} + data-testid="sidebar-quit" + sx={{ color: 'white' }} /> )} -
+
); }; diff --git a/src/renderer/components/__snapshots__/AccountNotifications.test.tsx.snap b/src/renderer/components/__snapshots__/AccountNotifications.test.tsx.snap deleted file mode 100644 index bbc1ca768..000000000 --- a/src/renderer/components/__snapshots__/AccountNotifications.test.tsx.snap +++ /dev/null @@ -1,2443 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/AccountNotifications.tsx should render itself - account error 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- -
-
- - - - - - -
-
-
-
- - 🔥 - -
-
- Error title -
-
- Error description -
-
-
- , - "container":
-
-
- -
-
- - - - - - -
-
-
-
- - 🔥 - -
-
- Error title -
-
- Error description -
-
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/AccountNotifications.tsx should render itself - group notifications by date 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- -
-
- - - - - - -
-
-
-
- - - - -
-
-
- - gitify-app/notifications-test's avatar - - - gitify-app/notifications-test - -
-
- - I am a robot and this is a test! - - -
-
- -
- Updated -
-
- 7 years ago -
-
- - -
-
-
-
- - - -
-
-
-
- - - - -
-
-
- - gitify-app/notifications-test's avatar - - - gitify-app/notifications-test - -
-
- - Improve the UI - - -
-
-
- -
-
- Authored -
-
- 7 years ago -
-
-
-
-
- - - -
-
-
- , - "container":
-
-
- -
-
- - - - - - -
-
-
-
- - - - -
-
-
- - gitify-app/notifications-test's avatar - - - gitify-app/notifications-test - -
-
- - I am a robot and this is a test! - - -
-
- -
- Updated -
-
- 7 years ago -
-
- - -
-
-
-
- - - -
-
-
-
- - - - -
-
-
- - gitify-app/notifications-test's avatar - - - gitify-app/notifications-test - -
-
- - Improve the UI - - -
-
-
- -
-
- Authored -
-
- 7 years ago -
-
-
-
-
- - - -
-
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/AccountNotifications.tsx should render itself - group notifications by repositories 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- -
-
- - - - - - -
-
-
- Repository Notifications -
-
- , - "container":
-
-
- -
-
- - - - - - -
-
-
- Repository Notifications -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/AccountNotifications.tsx should render itself - no notifications 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- -
-
- - - - - - -
-
-
-
- - 🎊 - -
-
- No new notifications. -
-
-
- , - "container":
-
-
- -
-
- - - - - - -
-
-
-
- - 🎊 - -
-
- No new notifications. -
-
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/AccountNotifications.tsx should toggle account notifications visibility 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- -
-
- - - - - - -
-
-
-
-
-
- -
-
- - - - - - -
-
-
- Repository Notifications -
-
- , - "container":
-
-
- -
-
- - - - - - -
-
-
- Repository Notifications -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/__snapshots__/AllRead.test.tsx.snap b/src/renderer/components/__snapshots__/AllRead.test.tsx.snap index d3366fcbb..b28381556 100644 --- a/src/renderer/components/__snapshots__/AllRead.test.tsx.snap +++ b/src/renderer/components/__snapshots__/AllRead.test.tsx.snap @@ -1,12 +1,53 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/AllRead.tsx should render itself & its children 1`] = ` +exports[`renderer/components/AllRead.tsx should render itself & its children - no filters 1`] = ` { "asFragment": [Function], "baseElement":
+
+
+ + 🎊 + +
+
+ No new notifications +
+
+
+
+ , + "container":
+
+
- No new notifications. + No new notifications +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/AllRead.tsx should render itself & its children - with filters 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+
+ + 🎊 + +
+
+ No new filtered notifications +
, "container":
- - 🎊 - -
-
- No new notifications. +
+ + 🎊 + +
+
+ No new filtered notifications +
, diff --git a/src/renderer/components/__snapshots__/NotificationRow.test.tsx.snap b/src/renderer/components/__snapshots__/NotificationRow.test.tsx.snap deleted file mode 100644 index 50174ff78..000000000 --- a/src/renderer/components/__snapshots__/NotificationRow.test.tsx.snap +++ /dev/null @@ -1,1340 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/NotificationRow.tsx should render itself & its children - group by date 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- - - - -
-
-
- - gitify-app/notifications-test's avatar - - - gitify-app/notifications-test - -
-
- - I am a robot and this is a test! - - -
-
- -
- Updated -
-
- 7 years ago -
-
- - -
-
-
-
- - - -
-
-
- , - "container":
-
-
- - - - -
-
-
- - gitify-app/notifications-test's avatar - - - gitify-app/notifications-test - -
-
- - I am a robot and this is a test! - - -
-
- -
- Updated -
-
- 7 years ago -
-
- - -
-
-
-
- - - -
-
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/NotificationRow.tsx should render itself & its children - group by repositories 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- - - - -
-
-
- - I am a robot and this is a test! - - -
-
- -
- Updated -
-
- 7 years ago -
-
- - -
-
-
-
- - - -
-
-
- , - "container":
-
-
- - - - -
-
-
- - I am a robot and this is a test! - - -
-
- -
- Updated -
-
- 7 years ago -
-
- - -
-
-
-
- - - -
-
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/NotificationRow.tsx should render itself & its children - hide numbers 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- - - - -
-
-
- - I am a robot and this is a test! - -
-
- -
- Updated -
-
- 7 years ago -
-
- - -
-
-
-
- - - -
-
-
- , - "container":
-
-
- - - - -
-
-
- - I am a robot and this is a test! - -
-
- -
- Updated -
-
- 7 years ago -
-
- - -
-
-
-
- - - -
-
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/__snapshots__/Oops.test.tsx.snap b/src/renderer/components/__snapshots__/Oops.test.tsx.snap index fba1b4179..2bae40bfd 100644 --- a/src/renderer/components/__snapshots__/Oops.test.tsx.snap +++ b/src/renderer/components/__snapshots__/Oops.test.tsx.snap @@ -6,7 +6,53 @@ exports[`renderer/components/Oops.tsx should render itself & its children 1`] = "baseElement":
+
+
+ + 🔥 + +
+
+ Error title +
+
+ Error description +
+
+
+
+ , + "container":
+
+
- , - "container":
-
-
- - 🔥 - -
-
- Error title -
-
- Error description -
-
, "debug": [Function], "findAllByAltText": [Function], diff --git a/src/renderer/components/__snapshots__/RepositoryNotifications.test.tsx.snap b/src/renderer/components/__snapshots__/RepositoryNotifications.test.tsx.snap deleted file mode 100644 index d81842f86..000000000 --- a/src/renderer/components/__snapshots__/RepositoryNotifications.test.tsx.snap +++ /dev/null @@ -1,868 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/RepositoryNotifications.tsx should render itself & its children 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- gitify-app/notifications-test's avatar - - gitify-app/notifications-test - -
-
- - - -
-
-
- NotificationRow -
-
- NotificationRow -
-
- , - "container":
-
-
- gitify-app/notifications-test's avatar - - gitify-app/notifications-test - -
-
- - - -
-
-
- NotificationRow -
-
- NotificationRow -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/RepositoryNotifications.tsx should toggle repository notifications visibility 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- - - gitify-app/notifications-test - -
-
- - - -
-
-
-
-
-
- - - gitify-app/notifications-test - -
-
- - - -
-
-
- NotificationRow -
-
- NotificationRow -
-
- , - "container":
-
-
- - - gitify-app/notifications-test - -
-
- - - -
-
-
- NotificationRow -
-
- NotificationRow -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/RepositoryNotifications.tsx should use default repository icon when avatar is not available 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- - - gitify-app/notifications-test - -
-
- - - -
-
-
- NotificationRow -
-
- NotificationRow -
-
- , - "container":
-
-
- - - gitify-app/notifications-test - -
-
- - - -
-
-
- NotificationRow -
-
- NotificationRow -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/__snapshots__/Sidebar.test.tsx.snap b/src/renderer/components/__snapshots__/Sidebar.test.tsx.snap index 15fa26359..071627181 100644 --- a/src/renderer/components/__snapshots__/Sidebar.test.tsx.snap +++ b/src/renderer/components/__snapshots__/Sidebar.test.tsx.snap @@ -1,23 +1,343 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`renderer/components/Sidebar.tsx notifications icon renders correct icon when there are no notifications 1`] = ` + +`; + +exports[`renderer/components/Sidebar.tsx notifications icon renders correct icon when there are notifications 1`] = ` + +`; + exports[`renderer/components/Sidebar.tsx should render itself & its children (logged in) 1`] = ` { "asFragment": [Function], "baseElement":
+
+
+ + + Home + + + + 4 unread notifications + + + + + +
+
+
+ + +
+
+
+ , + "container":
+
+
+ + Home + + + 4 unread notifications + - -
-
+ My issues + -
-
-
- , - "container":
-
-
- - - - + My pull requests + +
+
, @@ -367,18 +611,278 @@ exports[`renderer/components/Sidebar.tsx should render itself & its children (lo "baseElement":
+
+
+ + + Home + + + + 4 unread notifications + + + + + +
+
+
+ + +
+
+
+ , + "container":
+
+
+ + Home + + + 4 unread notifications + - -
-
+ My issues + -
-
-
- , - "container":
-
-
- - - - + My pull requests + +
+
, diff --git a/src/renderer/components/buttons/Button.test.tsx b/src/renderer/components/buttons/Button.test.tsx deleted file mode 100644 index cd6db0f87..000000000 --- a/src/renderer/components/buttons/Button.test.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { MarkGithubIcon } from '@primer/octicons-react'; -import { fireEvent, render, screen } from '@testing-library/react'; -import type { Link } from '../../types'; -import * as comms from '../../utils/comms'; -import { Button, type IButton } from './Button'; - -describe('renderer/components/buttons/Button.tsx', () => { - const openExternalLinkMock = jest - .spyOn(comms, 'openExternalLink') - .mockImplementation(); - - const props: IButton = { - label: 'button', - }; - - afterEach(() => { - jest.clearAllMocks(); - }); - - it('should render without icon', () => { - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render with icon', () => { - const tree = render( - , - ); - expect(tree).toMatchSnapshot(); - }); - - it('should render with url', () => { - render( - , - ); - - const buttonElement = screen.getByLabelText('button'); - - fireEvent.click(buttonElement); - expect(openExternalLinkMock).toHaveBeenCalledTimes(1); - }); -}); diff --git a/src/renderer/components/buttons/Button.tsx b/src/renderer/components/buttons/Button.tsx deleted file mode 100644 index 0b7e0054a..000000000 --- a/src/renderer/components/buttons/Button.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import type { Icon } from '@primer/octicons-react'; -import { type VariantProps, cva } from 'class-variance-authority'; -import { type ButtonHTMLAttributes, forwardRef } from 'react'; -import { type Link, Size } from '../../types'; -import { cn } from '../../utils/cn'; -import { openExternalLink } from '../../utils/comms'; - -const buttonVariants = cva( - 'ring-offset-background focus-visible:ring-ring inline-flex w-fit items-center justify-center whitespace-nowrap rounded text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', - { - variants: { - variant: { - default: 'bg-gray-300 dark:text-black hover:opacity-90', - destructive: 'bg-red-600 text-white hover:opacity-90', - outline: - 'border-zinc-300 hover:text-inherit dark:hover:text-white border bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-600', - ghost: 'hover:bg-zinc-100 dark:hover:bg-zinc-600 dark:hover:text-white', - link: 'underline-offset-2 hover:underline', - }, - size: { - default: 'min-w-20 h-10 px-4 py-1', - inline: 'h-5 rounded-md px-2 py-1', - xs: 'h-7 rounded-md px-2 py-1', - sm: 'h-9 rounded-md px-2 py-1', - lg: 'h-11 rounded-md px-8', - icon: 'h-10 w-10', - }, - }, - defaultVariants: { - variant: 'default', - size: 'default', - }, - }, -); - -export interface IButton - extends ButtonHTMLAttributes, - VariantProps { - icon?: { icon: Icon; size?: Size }; - url?: Link; - onClick?: () => void; - label: string; -} - -const Button = forwardRef( - ({ className, variant, size, label, url, onClick, ...props }, ref) => { - return ( - - ); - }, -); -Button.displayName = 'Button'; - -export { Button, buttonVariants }; diff --git a/src/renderer/components/buttons/InteractionButton.test.tsx b/src/renderer/components/buttons/InteractionButton.test.tsx deleted file mode 100644 index 1acc4a087..000000000 --- a/src/renderer/components/buttons/InteractionButton.test.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { MarkGithubIcon } from '@primer/octicons-react'; -import { render } from '@testing-library/react'; -import { Size } from '../../types'; -import { - type IInteractionButton, - InteractionButton, -} from './InteractionButton'; - -describe('renderer/components/buttons/InteractionButton.tsx', () => { - it('should render', () => { - const props: IInteractionButton = { - title: 'Mock Interaction Button', - icon: MarkGithubIcon, - size: Size.SMALL, - onClick: () => () => {}, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); -}); diff --git a/src/renderer/components/buttons/InteractionButton.tsx b/src/renderer/components/buttons/InteractionButton.tsx deleted file mode 100644 index 94bd9745b..000000000 --- a/src/renderer/components/buttons/InteractionButton.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import type { Icon } from '@primer/octicons-react'; -import type { FC, MouseEvent } from 'react'; -import type { Size } from '../../types'; - -export interface IInteractionButton { - title: string; - icon: Icon; - size: Size; - onClick: (event?: MouseEvent) => void; -} - -export const InteractionButton: FC = ( - props: IInteractionButton, -) => { - return ( - - ); -}; diff --git a/src/renderer/components/buttons/PillButton.test.tsx b/src/renderer/components/buttons/PillButton.test.tsx index f3ca4cd6b..9d446c4e4 100644 --- a/src/renderer/components/buttons/PillButton.test.tsx +++ b/src/renderer/components/buttons/PillButton.test.tsx @@ -4,7 +4,7 @@ import { IconColor } from '../../types'; import { type IPillButton, PillButton } from './PillButton'; describe('renderer/components/buttons/PillButton.tsx', () => { - it('should render', () => { + it('should render with metric', () => { const props: IPillButton = { title: 'Mock Pill', metric: 1, @@ -14,4 +14,14 @@ describe('renderer/components/buttons/PillButton.tsx', () => { const tree = render(); expect(tree).toMatchSnapshot(); }); + + it('should render without metric', () => { + const props: IPillButton = { + title: 'Mock Pill', + icon: MarkGithubIcon, + color: IconColor.GREEN, + }; + const tree = render(); + expect(tree).toMatchSnapshot(); + }); }); diff --git a/src/renderer/components/buttons/PillButton.tsx b/src/renderer/components/buttons/PillButton.tsx index 0c1be3f29..9111827dc 100644 --- a/src/renderer/components/buttons/PillButton.tsx +++ b/src/renderer/components/buttons/PillButton.tsx @@ -1,5 +1,8 @@ -import type { Icon } from '@primer/octicons-react'; import type { FC } from 'react'; + +import type { Icon } from '@primer/octicons-react'; +import { Octicon, Stack, Text } from '@primer/react'; + import { type IconColor, Size } from '../../types'; export interface IPillButton { @@ -17,12 +20,10 @@ export const PillButton: FC = (props: IPillButton) => { type="button" className="flex gap-1 items-center m-0.5 rounded-full bg-gray-100 px-1 text-xxs hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700" > - - {props.metric} + + + {props.metric && {props.metric}} + ); }; diff --git a/src/renderer/components/buttons/SidebarButton.test.tsx b/src/renderer/components/buttons/SidebarButton.test.tsx deleted file mode 100644 index e3c0f68f0..000000000 --- a/src/renderer/components/buttons/SidebarButton.test.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { MarkGithubIcon } from '@primer/octicons-react'; -import { render } from '@testing-library/react'; -import { Size } from '../../types'; -import { type ISidebarButton, SidebarButton } from './SidebarButton'; - -describe('renderer/components/buttons/SidebarButton.tsx', () => { - it('should render with metric', () => { - const props: ISidebarButton = { - title: 'Mock Sidebar Button', - metric: 1, - icon: MarkGithubIcon, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render without metric', () => { - const props: ISidebarButton = { - title: 'Mock Sidebar Button', - metric: 0, - icon: MarkGithubIcon, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render - with specific size', () => { - const props: ISidebarButton = { - title: 'Mock Sidebar Button', - metric: 0, - icon: MarkGithubIcon, - size: Size.MEDIUM, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); -}); diff --git a/src/renderer/components/buttons/SidebarButton.tsx b/src/renderer/components/buttons/SidebarButton.tsx deleted file mode 100644 index ea9c11398..000000000 --- a/src/renderer/components/buttons/SidebarButton.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import type { Icon } from '@primer/octicons-react'; -import type { FC } from 'react'; -import { IconColor, Size } from '../../types'; -import { cn } from '../../utils/cn'; - -export interface ISidebarButton { - title: string; - metric?: number; - icon: Icon; - onClick?: () => void; - size?: Size; - loading?: boolean; - disabled?: boolean; -} - -export const SidebarButton: FC = (props: ISidebarButton) => { - const hasMetric = props?.metric > 0; - - return ( - - ); -}; diff --git a/src/renderer/components/buttons/__snapshots__/Button.test.tsx.snap b/src/renderer/components/buttons/__snapshots__/Button.test.tsx.snap deleted file mode 100644 index bce89d3cb..000000000 --- a/src/renderer/components/buttons/__snapshots__/Button.test.tsx.snap +++ /dev/null @@ -1,181 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/buttons/Button.tsx should render with icon 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/buttons/Button.tsx should render without icon 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/buttons/__snapshots__/InteractionButton.test.tsx.snap b/src/renderer/components/buttons/__snapshots__/InteractionButton.test.tsx.snap deleted file mode 100644 index 15c211d38..000000000 --- a/src/renderer/components/buttons/__snapshots__/InteractionButton.test.tsx.snap +++ /dev/null @@ -1,106 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/buttons/InteractionButton.tsx should render 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/buttons/__snapshots__/PillButton.test.tsx.snap b/src/renderer/components/buttons/__snapshots__/PillButton.test.tsx.snap index dec4c232b..821a692f8 100644 --- a/src/renderer/components/buttons/__snapshots__/PillButton.test.tsx.snap +++ b/src/renderer/components/buttons/__snapshots__/PillButton.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/buttons/PillButton.tsx should render 1`] = ` +exports[`renderer/components/buttons/PillButton.tsx should render with metric 1`] = ` { "asFragment": [Function], "baseElement": @@ -9,14 +9,60 @@ exports[`renderer/components/buttons/PillButton.tsx should render 1`] = ` class="flex gap-1 items-center m-0.5 rounded-full bg-gray-100 px-1 text-xxs hover:bg-gray-200 dark:bg-gray-800 dark:hover:bg-gray-700" title="Mock Pill" type="button" + > +
+ + + 1 + +
+ +
+ , + "container":
+ +
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/buttons/PillButton.tsx should render without metric 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
, @@ -35,22 +176,30 @@ exports[`renderer/components/buttons/PillButton.tsx should render 1`] = ` title="Mock Pill" type="button" > - - - - 1 + +
, "debug": [Function], diff --git a/src/renderer/components/buttons/__snapshots__/SidebarButton.test.tsx.snap b/src/renderer/components/buttons/__snapshots__/SidebarButton.test.tsx.snap deleted file mode 100644 index 841b510a7..000000000 --- a/src/renderer/components/buttons/__snapshots__/SidebarButton.test.tsx.snap +++ /dev/null @@ -1,318 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/buttons/SidebarButton.tsx should render - with specific size 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/buttons/SidebarButton.tsx should render with metric 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/buttons/SidebarButton.tsx should render without metric 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/icons/AuthMethodIcon.test.tsx b/src/renderer/components/icons/AuthMethodIcon.test.tsx deleted file mode 100644 index 8496de2b2..000000000 --- a/src/renderer/components/icons/AuthMethodIcon.test.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { render } from '@testing-library/react'; -import { Size } from '../../types'; -import { AuthMethodIcon, type IAuthMethodIcon } from './AuthMethodIcon'; - -describe('renderer/components/icons/AuthMethodIcon.tsx', () => { - it('should render GitHub App icon', () => { - const props: IAuthMethodIcon = { - type: 'GitHub App', - size: Size.MEDIUM, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render Personal Access Token icon', () => { - const props: IAuthMethodIcon = { - type: 'Personal Access Token', - size: Size.MEDIUM, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render OAuth App icon', () => { - const props: IAuthMethodIcon = { - type: 'OAuth App', - size: Size.MEDIUM, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); -}); diff --git a/src/renderer/components/icons/AuthMethodIcon.tsx b/src/renderer/components/icons/AuthMethodIcon.tsx deleted file mode 100644 index 90251bd79..000000000 --- a/src/renderer/components/icons/AuthMethodIcon.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { AppsIcon, KeyIcon, PersonIcon } from '@primer/octicons-react'; -import type { FC } from 'react'; -import type { Size } from '../../types'; -import type { AuthMethod } from '../../utils/auth/types'; - -export interface IAuthMethodIcon { - type: AuthMethod; - size: Size; -} - -export const AuthMethodIcon: FC = (props: IAuthMethodIcon) => { - return ( - - {props.type === 'GitHub App' && } - {props.type === 'Personal Access Token' && } - {props.type === 'OAuth App' && } - - ); -}; diff --git a/src/renderer/components/icons/AvatarIcon.test.tsx b/src/renderer/components/icons/AvatarIcon.test.tsx deleted file mode 100644 index 99859a98f..000000000 --- a/src/renderer/components/icons/AvatarIcon.test.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { MarkGithubIcon } from '@primer/octicons-react'; -import { render } from '@testing-library/react'; -import { Size } from '../../types'; -import { AvatarIcon, type IAvatarIcon } from './AvatarIcon'; - -describe('renderer/components/icons/AvatarIcon.tsx', () => { - it('should render extra small avatar', () => { - const props: IAvatarIcon = { - defaultIcon: MarkGithubIcon, - title: 'test', - url: 'https://avatars.githubusercontent.com/u/583231?v=4', - size: Size.XSMALL, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render small avatar', () => { - const props: IAvatarIcon = { - defaultIcon: MarkGithubIcon, - title: 'test', - url: 'https://avatars.githubusercontent.com/u/583231?v=4', - size: Size.SMALL, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render medium avatar', () => { - const props: IAvatarIcon = { - defaultIcon: MarkGithubIcon, - title: 'test', - url: 'https://avatars.githubusercontent.com/u/583231?v=4', - size: Size.MEDIUM, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render default extra small icon when no url', () => { - const props: IAvatarIcon = { - defaultIcon: MarkGithubIcon, - title: 'test', - url: null, - size: Size.XSMALL, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render default small icon when no url', () => { - const props: IAvatarIcon = { - defaultIcon: MarkGithubIcon, - title: 'test', - url: null, - size: Size.SMALL, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render default medium icon when no url', () => { - const props: IAvatarIcon = { - defaultIcon: MarkGithubIcon, - title: 'test', - url: null, - size: Size.MEDIUM, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); -}); diff --git a/src/renderer/components/icons/AvatarIcon.tsx b/src/renderer/components/icons/AvatarIcon.tsx deleted file mode 100644 index 7db4f4856..000000000 --- a/src/renderer/components/icons/AvatarIcon.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import type { Icon } from '@primer/octicons-react'; -import type { FC } from 'react'; -import { Size } from '../../types'; -import { cn } from '../../utils/cn'; - -export interface IAvatarIcon { - title: string; - url: string | null; - size: Size.XSMALL | Size.SMALL | Size.MEDIUM; - defaultIcon: Icon; -} - -export const AvatarIcon: FC = (props: IAvatarIcon) => { - if (props.url) { - return ( - {`${props.title}'s - ); - } - - const defaultIconSize = - props.size === Size.XSMALL ? 16 : props.size === Size.SMALL ? 20 : 24; - - return ( - - ); -}; diff --git a/src/renderer/components/icons/LogoIcon.tsx b/src/renderer/components/icons/LogoIcon.tsx index 0024278ce..f080b0b2c 100644 --- a/src/renderer/components/icons/LogoIcon.tsx +++ b/src/renderer/components/icons/LogoIcon.tsx @@ -1,4 +1,5 @@ import type { FC } from 'react'; + import { Size } from '../../types'; import { cn } from '../../utils/cn'; @@ -17,7 +18,7 @@ const DARK_GRADIENT_END = '#555B6E'; export const LogoIcon: FC = ({ isDark, onClick, - size = Size.MEDIUM, + size = Size.SMALL, ...props }: ILogoIcon) => ( { - it('should render GitHub Cloud icon', () => { - const props: IPlatformIcon = { - type: 'GitHub Cloud', - size: Size.MEDIUM, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); - - it('should render GitHub Enterprise Service icon', () => { - const props: IPlatformIcon = { - type: 'GitHub Enterprise Server', - size: Size.MEDIUM, - }; - const tree = render(); - expect(tree).toMatchSnapshot(); - }); -}); diff --git a/src/renderer/components/icons/PlatformIcon.tsx b/src/renderer/components/icons/PlatformIcon.tsx deleted file mode 100644 index 7fb50501c..000000000 --- a/src/renderer/components/icons/PlatformIcon.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { MarkGithubIcon, ServerIcon } from '@primer/octicons-react'; -import type { FC } from 'react'; -import type { Size } from '../../types'; -import type { PlatformType } from '../../utils/auth/types'; - -export interface IPlatformIcon { - type: PlatformType; - size: Size; -} - -export const PlatformIcon: FC = (props: IPlatformIcon) => { - return ( - - {props.type === 'GitHub Cloud' && } - {props.type === 'GitHub Enterprise Server' && ( - - )} - - ); -}; diff --git a/src/renderer/components/icons/__snapshots__/AuthMethodIcon.test.tsx.snap b/src/renderer/components/icons/__snapshots__/AuthMethodIcon.test.tsx.snap deleted file mode 100644 index caa2602a9..000000000 --- a/src/renderer/components/icons/__snapshots__/AuthMethodIcon.test.tsx.snap +++ /dev/null @@ -1,304 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/icons/AuthMethodIcon.tsx should render GitHub App icon 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- - - -
- , - "container":
- - - -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/icons/AuthMethodIcon.tsx should render OAuth App icon 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- - - -
- , - "container":
- - - -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/icons/AuthMethodIcon.tsx should render Personal Access Token icon 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- - - -
- , - "container":
- - - -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/icons/__snapshots__/AvatarIcon.test.tsx.snap b/src/renderer/components/icons/__snapshots__/AvatarIcon.test.tsx.snap deleted file mode 100644 index e7880e375..000000000 --- a/src/renderer/components/icons/__snapshots__/AvatarIcon.test.tsx.snap +++ /dev/null @@ -1,493 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/icons/AvatarIcon.tsx should render default extra small icon when no url 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/icons/AvatarIcon.tsx should render default medium icon when no url 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/icons/AvatarIcon.tsx should render default small icon when no url 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/icons/AvatarIcon.tsx should render extra small avatar 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- test's avatar -
- , - "container":
- test's avatar -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/icons/AvatarIcon.tsx should render medium avatar 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- test's avatar -
- , - "container":
- test's avatar -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/icons/AvatarIcon.tsx should render small avatar 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- test's avatar -
- , - "container":
- test's avatar -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/icons/__snapshots__/PlatformIcon.test.tsx.snap b/src/renderer/components/icons/__snapshots__/PlatformIcon.test.tsx.snap deleted file mode 100644 index ac1fdbb19..000000000 --- a/src/renderer/components/icons/__snapshots__/PlatformIcon.test.tsx.snap +++ /dev/null @@ -1,203 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/icons/PlatformIcon.tsx should render GitHub Cloud icon 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- - - -
- , - "container":
- - - -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/icons/PlatformIcon.tsx should render GitHub Enterprise Service icon 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- - - -
- , - "container":
- - - -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/notification/__snapshots__/Pills.test.tsx.snap b/src/renderer/components/notification/__snapshots__/Pills.test.tsx.snap deleted file mode 100644 index 1e787dfff..000000000 --- a/src/renderer/components/notification/__snapshots__/Pills.test.tsx.snap +++ /dev/null @@ -1,2182 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renderer/components/notification/Pills.tsx comment pills should render when 1 comment 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
- - - - -
-
- , - "container":
-
- - - - -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notification/Pills.tsx comment pills should render when more than 1 comments 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
- - - - -
-
- , - "container":
-
- - - - -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notification/Pills.tsx comment pills should render when no comments 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
- - - -
-
- , - "container":
-
- - - -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notification/Pills.tsx label pills should render labels pill 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
- - - - - -
-
- , - "container":
-
- - - - - -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notification/Pills.tsx linked issue pills should render issues pill when linked to multiple issues/prs 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
- - - -
-
- , - "container":
-
- - - -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notification/Pills.tsx linked issue pills should render issues pill when linked to one issue/pr 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
- - - -
-
- , - "container":
-
- - - -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notification/Pills.tsx milestone pills should render closed milestone pill 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
- - - - - - -
-
- , - "container":
-
- - - - - - -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notification/Pills.tsx milestone pills should render open milestone pill 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
- - - - - - -
-
- , - "container":
-
- - - - - - -
-
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; - -exports[`renderer/components/notification/Pills.tsx showPills disabled should not render any pills when showPills is disabled 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- , - "container":
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/AccountNotifications.test.tsx b/src/renderer/components/notifications/AccountNotifications.test.tsx similarity index 87% rename from src/renderer/components/AccountNotifications.test.tsx rename to src/renderer/components/notifications/AccountNotifications.test.tsx index db2665849..b2a7825dc 100644 --- a/src/renderer/components/AccountNotifications.test.tsx +++ b/src/renderer/components/notifications/AccountNotifications.test.tsx @@ -1,17 +1,20 @@ import { act, fireEvent, render, screen } from '@testing-library/react'; -import { mockGitHubCloudAccount, mockSettings } from '../__mocks__/state-mocks'; -import { ensureStableEmojis } from '../__mocks__/utils'; -import { AppContext } from '../context/App'; -import { GroupBy } from '../types'; -import { mockGitHubNotifications } from '../utils/api/__mocks__/response-mocks'; -import * as links from '../utils/links'; +import { + mockGitHubCloudAccount, + mockSettings, +} from '../../__mocks__/state-mocks'; +import { ensureStableEmojis } from '../../__mocks__/utils'; +import { AppContext } from '../../context/App'; +import { GroupBy } from '../../types'; +import { mockGitHubNotifications } from '../../utils/api/__mocks__/response-mocks'; +import * as links from '../../utils/links'; import { AccountNotifications } from './AccountNotifications'; jest.mock('./RepositoryNotifications', () => ({ RepositoryNotifications: () =>
Repository Notifications
, })); -describe('renderer/components/AccountNotifications.tsx', () => { +describe('renderer/components/notifications/AccountNotifications.tsx', () => { beforeEach(() => { ensureStableEmojis(); }); @@ -108,7 +111,7 @@ describe('renderer/components/AccountNotifications.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Open Profile')); + fireEvent.click(screen.getByTestId('account-profile')); expect(openAccountProfileMock).toHaveBeenCalledTimes(1); expect(openAccountProfileMock).toHaveBeenCalledWith(mockGitHubCloudAccount); @@ -134,7 +137,7 @@ describe('renderer/components/AccountNotifications.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('My Issues')); + fireEvent.click(screen.getByTestId('account-issues')); expect(openMyIssuesMock).toHaveBeenCalledTimes(1); expect(openMyIssuesMock).toHaveBeenCalledWith( @@ -162,7 +165,7 @@ describe('renderer/components/AccountNotifications.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('My Pull Requests')); + fireEvent.click(screen.getByTestId('account-pull-requests')); expect(openPullRequestsMock).toHaveBeenCalledTimes(1); expect(openPullRequestsMock).toHaveBeenCalledWith( @@ -186,7 +189,7 @@ describe('renderer/components/AccountNotifications.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Hide account notifications')); + fireEvent.click(screen.getByTestId('account-toggle')); const tree = render( diff --git a/src/renderer/components/AccountNotifications.tsx b/src/renderer/components/notifications/AccountNotifications.tsx similarity index 68% rename from src/renderer/components/AccountNotifications.tsx rename to src/renderer/components/notifications/AccountNotifications.tsx index cc9f6bdce..e9fdeba55 100644 --- a/src/renderer/components/AccountNotifications.tsx +++ b/src/renderer/components/notifications/AccountNotifications.tsx @@ -1,27 +1,30 @@ -import { - FeedPersonIcon, - GitPullRequestIcon, - IssueOpenedIcon, -} from '@primer/octicons-react'; import { type FC, type MouseEvent, useContext, useMemo, useState } from 'react'; -import { AppContext } from '../context/App'; -import { type Account, type GitifyError, Opacity, Size } from '../types'; -import type { Notification } from '../typesGitHub'; -import { cn } from '../utils/cn'; -import { getChevronDetails } from '../utils/helpers'; + +import { GitPullRequestIcon, IssueOpenedIcon } from '@primer/octicons-react'; +import { + Avatar, + Button, + IconButton, + Stack, + Text, + Tooltip, +} from '@primer/react'; + +import { AppContext } from '../../context/App'; +import { type Account, type GitifyError, Size } from '../../types'; +import type { Notification } from '../../typesGitHub'; +import { cn } from '../../utils/cn'; +import { getChevronDetails } from '../../utils/helpers'; import { openAccountProfile, openGitHubIssues, openGitHubPulls, -} from '../utils/links'; -import { AllRead } from './AllRead'; -import { HoverGroup } from './HoverGroup'; +} from '../../utils/links'; +import { AllRead } from '../AllRead'; +import { Oops } from '../Oops'; +import { HoverGroup } from '../primitives/HoverGroup'; import { NotificationRow } from './NotificationRow'; -import { Oops } from './Oops'; import { RepositoryNotifications } from './RepositoryNotifications'; -import { InteractionButton } from './buttons/InteractionButton'; -import { AvatarIcon } from './icons/AvatarIcon'; -import { PlatformIcon } from './icons/PlatformIcon'; interface IAccountNotifications { account: Account; @@ -74,62 +77,66 @@ export const AccountNotifications: FC = ( {showAccountHeader && (
-
- -
+ + + @{account.user.login} + + + + - - ) => { // Don't trigger onClick of parent element. event.stopPropagation(); openGitHubIssues(account.hostname); }} + data-testid="account-issues" /> - ) => { // Don't trigger onClick of parent element. event.stopPropagation(); openGitHubPulls(account.hostname); }} + data-testid="account-pull-requests" /> -
diff --git a/src/renderer/components/notification/NotificationFooter.test.tsx b/src/renderer/components/notifications/NotificationFooter.test.tsx similarity index 97% rename from src/renderer/components/notification/NotificationFooter.test.tsx rename to src/renderer/components/notifications/NotificationFooter.test.tsx index 3515d1a71..559721bc1 100644 --- a/src/renderer/components/notification/NotificationFooter.test.tsx +++ b/src/renderer/components/notifications/NotificationFooter.test.tsx @@ -10,7 +10,7 @@ import { mockSingleNotification } from '../../utils/api/__mocks__/response-mocks import * as comms from '../../utils/comms'; import { NotificationFooter } from './NotificationFooter'; -describe('renderer/components/notification/NotificationFooter.tsx', () => { +describe('renderer/components/notifications/NotificationFooter.tsx', () => { afterEach(() => { jest.clearAllMocks(); }); @@ -149,7 +149,7 @@ describe('renderer/components/notification/NotificationFooter.tsx', () => {
, ); - fireEvent.click(screen.getByTitle('View User Profile')); + fireEvent.click(screen.getByTestId('view-profile')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); expect(openExternalLinkMock).toHaveBeenCalledWith( props.notification.subject.user.html_url, diff --git a/src/renderer/components/notification/NotificationFooter.tsx b/src/renderer/components/notifications/NotificationFooter.tsx similarity index 64% rename from src/renderer/components/notification/NotificationFooter.tsx rename to src/renderer/components/notifications/NotificationFooter.tsx index ae075d473..52d6fa184 100644 --- a/src/renderer/components/notification/NotificationFooter.tsx +++ b/src/renderer/components/notifications/NotificationFooter.tsx @@ -1,12 +1,14 @@ -import { FeedPersonIcon, MarkGithubIcon } from '@primer/octicons-react'; import type { FC, MouseEvent } from 'react'; + +import { FeedPersonIcon, MarkGithubIcon } from '@primer/octicons-react'; +import { Avatar } from '@primer/react'; + import { IconColor, Opacity, Size } from '../../types'; import type { Notification } from '../../typesGitHub'; import { cn } from '../../utils/cn'; import { formatNotificationUpdatedAt } from '../../utils/helpers'; import { openUserProfile } from '../../utils/links'; import { formatReason } from '../../utils/reason'; -import { AvatarIcon } from '../icons/AvatarIcon'; import { Pills } from './Pills'; interface INotificationFooter { @@ -24,42 +26,41 @@ export const NotificationFooter: FC = ({ : `Updated ${updatedAt}`; return ( -
+
{notification.subject.user ? ( - + data-testid="view-profile" + /> ) : ( -
+ <> {notification.subject.type === 'RepositoryDependabotAlertsThread' || notification.subject.type === 'RepositoryVulnerabilityAlert' ? ( - + ) : ( - + )} -
+ )} -
{reason.title}
-
{updatedAt}
+ + {reason.title} + + + {updatedAt} +
); diff --git a/src/renderer/components/notification/NotificationHeader.test.tsx b/src/renderer/components/notifications/NotificationHeader.test.tsx similarity index 92% rename from src/renderer/components/notification/NotificationHeader.test.tsx rename to src/renderer/components/notifications/NotificationHeader.test.tsx index a27cb57c7..366b1f5fe 100644 --- a/src/renderer/components/notification/NotificationHeader.test.tsx +++ b/src/renderer/components/notifications/NotificationHeader.test.tsx @@ -6,7 +6,7 @@ import { mockSingleNotification } from '../../utils/api/__mocks__/response-mocks import * as comms from '../../utils/comms'; import { NotificationHeader } from './NotificationHeader'; -describe('renderer/components/notification/NotificationHeader.tsx', () => { +describe('renderer/components/notifications/NotificationHeader.tsx', () => { afterEach(() => { jest.clearAllMocks(); }); @@ -58,7 +58,7 @@ describe('renderer/components/notification/NotificationHeader.tsx', () => { , ); - fireEvent.click(screen.getByTitle(props.notification.repository.full_name)); + fireEvent.click(screen.getByTestId('view-repository')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); expect(openExternalLinkMock).toHaveBeenCalledWith( props.notification.repository.html_url, diff --git a/src/renderer/components/notification/NotificationHeader.tsx b/src/renderer/components/notifications/NotificationHeader.tsx similarity index 56% rename from src/renderer/components/notification/NotificationHeader.tsx rename to src/renderer/components/notifications/NotificationHeader.tsx index a4c9dd1ff..c28052cf0 100644 --- a/src/renderer/components/notification/NotificationHeader.tsx +++ b/src/renderer/components/notifications/NotificationHeader.tsx @@ -1,11 +1,11 @@ -import { MarkGithubIcon } from '@primer/octicons-react'; import { type FC, type MouseEvent, useContext } from 'react'; + +import { Avatar, Stack, Tooltip } from '@primer/react'; + import { AppContext } from '../../context/App'; -import { Opacity, Size } from '../../types'; +import { Size } from '../../types'; import type { Notification } from '../../typesGitHub'; -import { cn } from '../../utils/cn'; import { openRepository } from '../../utils/links'; -import { AvatarIcon } from '../icons/AvatarIcon'; interface INotificationHeader { notification: Notification; @@ -23,32 +23,21 @@ export const NotificationHeader: FC = ({ return ( groupByDate && ( -
- - - - +
) => { // Don't trigger onClick of parent element. event.stopPropagation(); openRepository(notification.repository); }} + data-testid="view-repository" > - {repoSlug} - -
+ + + {repoSlug} + +
+ ) ); }; diff --git a/src/renderer/components/NotificationRow.test.tsx b/src/renderer/components/notifications/NotificationRow.test.tsx similarity index 77% rename from src/renderer/components/NotificationRow.test.tsx rename to src/renderer/components/notifications/NotificationRow.test.tsx index cf050e683..e185092ab 100644 --- a/src/renderer/components/NotificationRow.test.tsx +++ b/src/renderer/components/notifications/NotificationRow.test.tsx @@ -3,16 +3,15 @@ import { mockAuth, mockGitHubCloudAccount, mockSettings, -} from '../__mocks__/state-mocks'; -import { AppContext } from '../context/App'; -import { GroupBy, type Link } from '../types'; -import type { UserType } from '../typesGitHub'; -import { mockSingleNotification } from '../utils/api/__mocks__/response-mocks'; -import * as comms from '../utils/comms'; -import * as links from '../utils/links'; +} from '../../__mocks__/state-mocks'; +import { AppContext } from '../../context/App'; +import { GroupBy } from '../../types'; +import { mockSingleNotification } from '../../utils/api/__mocks__/response-mocks'; +import * as comms from '../../utils/comms'; +import * as links from '../../utils/links'; import { NotificationRow } from './NotificationRow'; -describe('renderer/components/NotificationRow.tsx', () => { +describe('renderer/components/notifications/NotificationRow.tsx', () => { jest.spyOn(links, 'openNotification'); jest.spyOn(comms, 'openExternalLink').mockImplementation(); @@ -101,7 +100,7 @@ describe('renderer/components/NotificationRow.tsx', () => { , ); - fireEvent.click(screen.getByRole('main')); + fireEvent.click(screen.getByTestId('notification-row')); expect(links.openNotification).toHaveBeenCalledTimes(1); expect(markNotificationsAsRead).toHaveBeenCalledTimes(1); }); @@ -130,7 +129,7 @@ describe('renderer/components/NotificationRow.tsx', () => { , ); - fireEvent.click(screen.getByRole('main')); + fireEvent.click(screen.getByTestId('notification-row')); expect(links.openNotification).toHaveBeenCalledTimes(1); expect(markNotificationsAsRead).toHaveBeenCalledTimes(1); }); @@ -155,7 +154,7 @@ describe('renderer/components/NotificationRow.tsx', () => { , ); - fireEvent.click(screen.getByRole('main')); + fireEvent.click(screen.getByTestId('notification-row')); expect(links.openNotification).toHaveBeenCalledTimes(1); expect(markNotificationsAsRead).toHaveBeenCalledTimes(1); }); @@ -180,7 +179,7 @@ describe('renderer/components/NotificationRow.tsx', () => { , ); - fireEvent.click(screen.getByRole('main')); + fireEvent.click(screen.getByTestId('notification-row')); expect(links.openNotification).toHaveBeenCalledTimes(1); expect(markNotificationsAsDone).toHaveBeenCalledTimes(1); }); @@ -204,7 +203,7 @@ describe('renderer/components/NotificationRow.tsx', () => { , ); - fireEvent.click(screen.getByTitle('Mark as read')); + fireEvent.click(screen.getByTestId('notification-mark-as-read')); expect(markNotificationsAsRead).toHaveBeenCalledTimes(1); }); @@ -224,7 +223,7 @@ describe('renderer/components/NotificationRow.tsx', () => { , ); - fireEvent.click(screen.getByTitle('Mark as done')); + fireEvent.click(screen.getByTestId('notification-mark-as-done')); expect(markNotificationsAsDone).toHaveBeenCalledTimes(1); }); @@ -245,47 +244,10 @@ describe('renderer/components/NotificationRow.tsx', () => { , ); - fireEvent.click(screen.getByTitle('Unsubscribe from Thread')); - expect(unsubscribeNotification).toHaveBeenCalledTimes(1); - }); - - it('should open notification user profile', () => { - const openExternalLinkMock = jest.spyOn(comms, 'openExternalLink'); - - const props = { - notification: { - ...mockSingleNotification, - subject: { - ...mockSingleNotification.subject, - user: { - login: 'some-user', - html_url: 'https://github.com/some-user' as Link, - avatar_url: - 'https://avatars.githubusercontent.com/u/123456789?v=4' as Link, - type: 'User' as UserType, - }, - reviews: null, - }, - }, - account: mockGitHubCloudAccount, - }; - - render( - - - , - ); - - fireEvent.click(screen.getByTitle('View User Profile')); - expect(openExternalLinkMock).toHaveBeenCalledTimes(1); - expect(openExternalLinkMock).toHaveBeenCalledWith( - props.notification.subject.user.html_url, + fireEvent.click( + screen.getByTestId('notification-unsubscribe-from-thread'), ); + expect(unsubscribeNotification).toHaveBeenCalledTimes(1); }); }); }); diff --git a/src/renderer/components/NotificationRow.tsx b/src/renderer/components/notifications/NotificationRow.tsx similarity index 70% rename from src/renderer/components/NotificationRow.tsx rename to src/renderer/components/notifications/NotificationRow.tsx index 3bd305433..8411d6244 100644 --- a/src/renderer/components/NotificationRow.tsx +++ b/src/renderer/components/notifications/NotificationRow.tsx @@ -1,4 +1,3 @@ -import { BellSlashIcon, CheckIcon, ReadIcon } from '@primer/octicons-react'; import { type FC, type MouseEvent, @@ -6,23 +5,26 @@ import { useContext, useState, } from 'react'; -import { AppContext } from '../context/App'; -import { Opacity, Size } from '../types'; -import type { Notification } from '../typesGitHub'; -import { cn } from '../utils/cn'; + +import { BellSlashIcon, CheckIcon, ReadIcon } from '@primer/octicons-react'; +import { IconButton, Octicon, Tooltip } from '@primer/react'; + +import { AppContext } from '../../context/App'; +import { Opacity, Size } from '../../types'; +import type { Notification } from '../../typesGitHub'; +import { cn } from '../../utils/cn'; import { formatForDisplay, isMarkAsDoneFeatureSupported, -} from '../utils/helpers'; +} from '../../utils/helpers'; import { getNotificationTypeIcon, getNotificationTypeIconColor, -} from '../utils/icons'; -import { openNotification } from '../utils/links'; -import { HoverGroup } from './HoverGroup'; -import { InteractionButton } from './buttons/InteractionButton'; -import { NotificationFooter } from './notification/NotificationFooter'; -import { NotificationHeader } from './notification/NotificationHeader'; +} from '../../utils/icons'; +import { openNotification } from '../../utils/links'; +import { HoverGroup } from '../primitives/HoverGroup'; +import { NotificationFooter } from './NotificationFooter'; +import { NotificationHeader } from './NotificationHeader'; interface INotificationRow { notification: Notification; @@ -84,26 +86,20 @@ export const NotificationRow: FC = ({ const notificationTitle = `${notification.subject.title} ${notificationNumber}`.trim(); - const groupByDate = settings.groupBy === 'DATE'; - return (
-
- +
+ + +
= ({
{notification.subject.title} = ({ {!animateExit && ( {isMarkAsDoneFeatureSupported(notification.account) && ( - { setAnimateExit(!settings.delayNotificationState); setShowAsRead(settings.delayNotificationState); markNotificationsAsDone([notification]); }} + data-testid="notification-mark-as-done" /> )} - { setAnimateExit(!settings.delayNotificationState); setShowAsRead(settings.delayNotificationState); markNotificationsAsRead([notification]); }} + data-testid="notification-mark-as-read" /> - )} diff --git a/src/renderer/components/notification/Pills.test.tsx b/src/renderer/components/notifications/Pills.test.tsx similarity index 98% rename from src/renderer/components/notification/Pills.test.tsx rename to src/renderer/components/notifications/Pills.test.tsx index dc1719d35..38f1d5f54 100644 --- a/src/renderer/components/notification/Pills.test.tsx +++ b/src/renderer/components/notifications/Pills.test.tsx @@ -5,7 +5,7 @@ import type { Milestone } from '../../typesGitHub'; import { mockSingleNotification } from '../../utils/api/__mocks__/response-mocks'; import { Pills } from './Pills'; -describe('renderer/components/notification/Pills.tsx', () => { +describe('renderer/components/notifications/Pills.tsx', () => { describe('showPills disabled', () => { it('should not render any pills when showPills is disabled', async () => { const mockNotification = mockSingleNotification; diff --git a/src/renderer/components/notification/Pills.tsx b/src/renderer/components/notifications/Pills.tsx similarity index 100% rename from src/renderer/components/notification/Pills.tsx rename to src/renderer/components/notifications/Pills.tsx index 5b6f877da..1cebe4750 100644 --- a/src/renderer/components/notification/Pills.tsx +++ b/src/renderer/components/notifications/Pills.tsx @@ -1,16 +1,16 @@ +import { type FC, useContext } from 'react'; + import { CommentIcon, IssueClosedIcon, MilestoneIcon, TagIcon, } from '@primer/octicons-react'; -import { type FC, useContext } from 'react'; + +import { AppContext } from '../../context/App'; import { IconColor } from '../../types'; import type { Notification } from '../../typesGitHub'; - import { getPullRequestReviewIcon } from '../../utils/icons'; - -import { AppContext } from '../../context/App'; import { PillButton } from '../buttons/PillButton'; interface IPills { diff --git a/src/renderer/components/RepositoryNotifications.test.tsx b/src/renderer/components/notifications/RepositoryNotifications.test.tsx similarity index 81% rename from src/renderer/components/RepositoryNotifications.test.tsx rename to src/renderer/components/notifications/RepositoryNotifications.test.tsx index da8bdd1e3..2aadeb17b 100644 --- a/src/renderer/components/RepositoryNotifications.test.tsx +++ b/src/renderer/components/notifications/RepositoryNotifications.test.tsx @@ -1,16 +1,19 @@ import { act, fireEvent, render, screen } from '@testing-library/react'; -import { mockGitHubCloudAccount, mockSettings } from '../__mocks__/state-mocks'; -import { AppContext } from '../context/App'; -import type { Link } from '../types'; -import { mockGitHubNotifications } from '../utils/api/__mocks__/response-mocks'; -import * as comms from '../utils/comms'; +import { + mockGitHubCloudAccount, + mockSettings, +} from '../../__mocks__/state-mocks'; +import { AppContext } from '../../context/App'; +import type { Link } from '../../types'; +import { mockGitHubNotifications } from '../../utils/api/__mocks__/response-mocks'; +import * as comms from '../../utils/comms'; import { RepositoryNotifications } from './RepositoryNotifications'; jest.mock('./NotificationRow', () => ({ NotificationRow: () =>
NotificationRow
, })); -describe('renderer/components/RepositoryNotifications.tsx', () => { +describe('renderer/components/notifications/RepositoryNotifications.tsx', () => { const markNotificationsAsRead = jest.fn(); const markNotificationsAsDone = jest.fn(); @@ -61,7 +64,7 @@ describe('renderer/components/RepositoryNotifications.tsx', () => { , ); - fireEvent.click(screen.getByTitle('Mark repository as read')); + fireEvent.click(screen.getByLabelText('Mark repository as read')); expect(markNotificationsAsRead).toHaveBeenCalledWith( mockGitHubNotifications, @@ -77,7 +80,7 @@ describe('renderer/components/RepositoryNotifications.tsx', () => { , ); - fireEvent.click(screen.getByTitle('Mark repository as done')); + fireEvent.click(screen.getByLabelText('Mark repository as done')); expect(markNotificationsAsDone).toHaveBeenCalledWith( mockGitHubNotifications, @@ -100,7 +103,7 @@ describe('renderer/components/RepositoryNotifications.tsx', () => { render(); }); - fireEvent.click(screen.getByTitle('Hide repository notifications')); + fireEvent.click(screen.getByLabelText('Hide repository notifications')); const tree = render(); expect(tree).toMatchSnapshot(); diff --git a/src/renderer/components/RepositoryNotifications.tsx b/src/renderer/components/notifications/RepositoryNotifications.tsx similarity index 61% rename from src/renderer/components/RepositoryNotifications.tsx rename to src/renderer/components/notifications/RepositoryNotifications.tsx index f48d64377..65c5fcc51 100644 --- a/src/renderer/components/RepositoryNotifications.tsx +++ b/src/renderer/components/notifications/RepositoryNotifications.tsx @@ -1,18 +1,26 @@ -import { CheckIcon, MarkGithubIcon, ReadIcon } from '@primer/octicons-react'; import { type FC, type MouseEvent, useContext, useState } from 'react'; -import { AppContext } from '../context/App'; -import { Opacity, Size } from '../types'; -import type { Notification } from '../typesGitHub'; -import { cn } from '../utils/cn'; + +import { CheckIcon, ReadIcon } from '@primer/octicons-react'; +import { + Avatar, + Button, + IconButton, + Stack, + Text, + Tooltip, +} from '@primer/react'; + +import { AppContext } from '../../context/App'; +import { Opacity, Size } from '../../types'; +import type { Notification } from '../../typesGitHub'; +import { cn } from '../../utils/cn'; import { getChevronDetails, isMarkAsDoneFeatureSupported, -} from '../utils/helpers'; -import { openRepository } from '../utils/links'; -import { HoverGroup } from './HoverGroup'; +} from '../../utils/helpers'; +import { openRepository } from '../../utils/links'; +import { HoverGroup } from '../primitives/HoverGroup'; import { NotificationRow } from './NotificationRow'; -import { InteractionButton } from './buttons/InteractionButton'; -import { AvatarIcon } from './icons/AvatarIcon'; interface IRepositoryNotifications { repoNotifications: Notification[]; @@ -45,7 +53,7 @@ export const RepositoryNotifications: FC = ({ return ( <>
= ({ 'flex flex-1 gap-3 items-center truncate text-sm font-medium', animateExit && 'translate-x-full opacity-0 transition duration-[350ms] ease-in-out', - showAsRead ? Opacity.READ : Opacity.MEDIUM, + showAsRead && Opacity.READ, )} > - - ) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); - openRepository(repoNotifications[0].repository); - }} - > - {repoName} - + + +
{!animateExit && ( {isMarkAsDoneFeatureSupported(repoNotifications[0].account) && ( - ) => { // Don't trigger onClick of parent element. event.stopPropagation(); @@ -90,10 +100,12 @@ export const RepositoryNotifications: FC = ({ }} /> )} - ) => { // Don't trigger onClick of parent element. event.stopPropagation(); @@ -102,10 +114,12 @@ export const RepositoryNotifications: FC = ({ markNotificationsAsRead(repoNotifications); }} /> - diff --git a/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap new file mode 100644 index 000000000..e15692538 --- /dev/null +++ b/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap @@ -0,0 +1,3799 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renderer/components/notifications/AccountNotifications.tsx should render itself - account error 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + +
+
+ + + + + + +
+
+
+
+
+
+ + 🔥 + +
+
+ Error title +
+
+ Error description +
+
+
+
+ , + "container":
+
+ + + +
+
+ + + + + + +
+
+
+
+
+
+ + 🔥 + +
+
+ Error title +
+
+ Error description +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/AccountNotifications.tsx should render itself - group notifications by date 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + +
+
+ + + + + + +
+
+
+
+
+ + + +
+
+ +
+
+ + + gitify-app/notifications-test + +
+
+
+
+ + I am a robot and this is a test! + + +
+
+ + + Updated + + + 7 years ago + +
+ + +
+
+
+
+
+ + + + + + +
+
+
+
+
+ + + +
+
+ +
+
+ + + gitify-app/notifications-test + +
+
+
+
+ + Improve the UI + + +
+
+ + + Authored + + + 7 years ago + +
+
+
+
+
+ + + + + + +
+
+
+
+ , + "container":
+
+ + + +
+
+ + + + + + +
+
+
+
+
+ + + +
+
+ +
+
+ + + gitify-app/notifications-test + +
+
+
+
+ + I am a robot and this is a test! + + +
+
+ + + Updated + + + 7 years ago + +
+ + +
+
+
+
+
+ + + + + + +
+
+
+
+
+ + + +
+
+ +
+
+ + + gitify-app/notifications-test + +
+
+
+
+ + Improve the UI + + +
+
+ + + Authored + + + 7 years ago + +
+
+
+
+
+ + + + + + +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/AccountNotifications.tsx should render itself - group notifications by repositories 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + +
+
+ + + + + + +
+
+
+
+ Repository Notifications +
+
+ , + "container":
+
+ + + +
+
+ + + + + + +
+
+
+
+ Repository Notifications +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/AccountNotifications.tsx should render itself - no notifications 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + +
+
+ + + + + + +
+
+
+
+
+
+ + 🎊 + +
+
+ No new notifications +
+
+
+
+ , + "container":
+
+ + + +
+
+ + + + + + +
+
+
+
+
+
+ + 🎊 + +
+
+ No new notifications +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/AccountNotifications.tsx should toggle account notifications visibility 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + +
+
+ + + + + + +
+
+
+
+
+
+ + + +
+
+ + + + + + +
+
+
+
+ Repository Notifications +
+
+ , + "container":
+
+ + + +
+
+ + + + + + +
+
+
+
+ Repository Notifications +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/src/renderer/components/notification/__snapshots__/NotificationFooter.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap similarity index 51% rename from src/renderer/components/notification/__snapshots__/NotificationFooter.test.tsx.snap rename to src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap index 300b4d59c..d7eee02fa 100644 --- a/src/renderer/components/notification/__snapshots__/NotificationFooter.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap @@ -1,34 +1,37 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/notification/NotificationFooter.tsx security alerts should use github icon for avatar Repository Dependabot Alerts Thread 1`] = ` +exports[`renderer/components/notifications/NotificationFooter.tsx security alerts should use github icon for avatar Repository Dependabot Alerts Thread 1`] = ` { "asFragment": [Function], "baseElement":
- -
+ Updated -
-
+ 7 years ago -
+
@@ -37,44 +40,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx security alerts title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
@@ -82,29 +111,32 @@ exports[`renderer/components/notification/NotificationFooter.tsx security alerts , "container":
- -
+ Updated -
-
+ 7 years ago -
+
@@ -113,44 +145,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx security alerts title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
@@ -209,35 +267,38 @@ exports[`renderer/components/notification/NotificationFooter.tsx security alerts } `; -exports[`renderer/components/notification/NotificationFooter.tsx security alerts should use github icon for avatar Repository Vulnerability Alert 1`] = ` +exports[`renderer/components/notifications/NotificationFooter.tsx security alerts should use github icon for avatar Repository Vulnerability Alert 1`] = ` { "asFragment": [Function], "baseElement":
- -
+ Updated -
-
+ 7 years ago -
+
@@ -246,44 +307,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx security alerts title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
@@ -291,29 +378,32 @@ exports[`renderer/components/notification/NotificationFooter.tsx security alerts , "container":
- -
+ Updated -
-
+ 7 years ago -
+
@@ -322,44 +412,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx security alerts title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
@@ -418,40 +534,40 @@ exports[`renderer/components/notification/NotificationFooter.tsx security alerts } `; -exports[`renderer/components/notification/NotificationFooter.tsx should default to known avatar if no user found 1`] = ` +exports[`renderer/components/notifications/NotificationFooter.tsx should default to known avatar if no user found 1`] = ` { "asFragment": [Function], "baseElement":
-
- -
- -
+ 7 years ago -
+
@@ -460,44 +576,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx should default title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
@@ -505,34 +647,34 @@ exports[`renderer/components/notification/NotificationFooter.tsx should default , "container":
-
- -
- -
+ 7 years ago -
+
@@ -541,44 +683,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx should default title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
@@ -637,35 +805,38 @@ exports[`renderer/components/notification/NotificationFooter.tsx should default } `; -exports[`renderer/components/notification/NotificationFooter.tsx should render itself & its children 1`] = ` +exports[`renderer/components/notifications/NotificationFooter.tsx should render itself & its children 1`] = ` { "asFragment": [Function], "baseElement":
- -
+ Updated -
-
+ 7 years ago -
+
@@ -674,44 +845,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx should render i title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
@@ -719,29 +916,32 @@ exports[`renderer/components/notification/NotificationFooter.tsx should render i , "container":
- -
+ Updated -
-
+ 7 years ago -
+
@@ -750,44 +950,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx should render i title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
@@ -846,35 +1072,38 @@ exports[`renderer/components/notification/NotificationFooter.tsx should render i } `; -exports[`renderer/components/notification/NotificationFooter.tsx should render itself & its children when last_read_at is null 1`] = ` +exports[`renderer/components/notifications/NotificationFooter.tsx should render itself & its children when last_read_at is null 1`] = ` { "asFragment": [Function], "baseElement":
- -
+ Updated -
-
+ 7 years ago -
+
@@ -883,44 +1112,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx should render i title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
@@ -928,29 +1183,32 @@ exports[`renderer/components/notification/NotificationFooter.tsx should render i , "container":
- -
+ Updated -
-
+ 7 years ago -
+
@@ -959,44 +1217,70 @@ exports[`renderer/components/notification/NotificationFooter.tsx should render i title="octocat approved these changes" type="button" > - - - - 1 + + + 1 + +
diff --git a/src/renderer/components/notification/__snapshots__/NotificationHeader.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/NotificationHeader.test.tsx.snap similarity index 63% rename from src/renderer/components/notification/__snapshots__/NotificationHeader.test.tsx.snap rename to src/renderer/components/notifications/__snapshots__/NotificationHeader.test.tsx.snap index 4377ac510..5a9bcb43c 100644 --- a/src/renderer/components/notification/__snapshots__/NotificationHeader.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/NotificationHeader.test.tsx.snap @@ -1,47 +1,85 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/notification/NotificationHeader.tsx should render itself & its children - group by date 1`] = ` +exports[`renderer/components/notifications/NotificationHeader.tsx should render itself & its children - group by date 1`] = ` { "asFragment": [Function], "baseElement":
- +
+ + + gitify-app/notifications-test + +
+
+
, "container":
- +
+ + + gitify-app/notifications-test + +
+
+ , "debug": [Function], "findAllByAltText": [Function], @@ -97,7 +135,7 @@ exports[`renderer/components/notification/NotificationHeader.tsx should render i } `; -exports[`renderer/components/notification/NotificationHeader.tsx should render itself & its children - group by repositories 1`] = ` +exports[`renderer/components/notifications/NotificationHeader.tsx should render itself & its children - group by repositories 1`] = ` { "asFragment": [Function], "baseElement": diff --git a/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap new file mode 100644 index 000000000..a2f5b10e7 --- /dev/null +++ b/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap @@ -0,0 +1,1912 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renderer/components/notifications/NotificationRow.tsx should render itself & its children - group by date 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+ + + +
+
+ +
+
+ + + gitify-app/notifications-test + +
+
+
+
+ + I am a robot and this is a test! + + +
+
+ + + Updated + + + 7 years ago + +
+ + +
+
+
+
+
+ + + + + + +
+
+
+
+ , + "container":
+
+
+ + + +
+
+ +
+
+ + + gitify-app/notifications-test + +
+
+
+
+ + I am a robot and this is a test! + + +
+
+ + + Updated + + + 7 years ago + +
+ + +
+
+
+
+
+ + + + + + +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/NotificationRow.tsx should render itself & its children - group by repositories 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+ + + +
+
+
+ + I am a robot and this is a test! + + +
+
+ + + Updated + + + 7 years ago + +
+ + +
+
+
+
+
+ + + + + + +
+
+
+
+ , + "container":
+
+
+ + + +
+
+
+ + I am a robot and this is a test! + + +
+
+ + + Updated + + + 7 years ago + +
+ + +
+
+
+
+
+ + + + + + +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/NotificationRow.tsx should render itself & its children - hide numbers 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+ + + +
+
+
+ + I am a robot and this is a test! + +
+
+ + + Updated + + + 7 years ago + +
+ + +
+
+
+
+
+ + + + + + +
+
+
+
+ , + "container":
+
+
+ + + +
+
+
+ + I am a robot and this is a test! + +
+
+ + + Updated + + + 7 years ago + +
+ + +
+
+
+
+
+ + + + + + +
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/src/renderer/components/notifications/__snapshots__/Pills.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/Pills.test.tsx.snap new file mode 100644 index 000000000..bf247f38a --- /dev/null +++ b/src/renderer/components/notifications/__snapshots__/Pills.test.tsx.snap @@ -0,0 +1,3044 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renderer/components/notifications/Pills.tsx comment pills should render when 1 comment 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + + +
+
+ , + "container":
+
+ + + + +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/Pills.tsx comment pills should render when more than 1 comments 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + + +
+
+ , + "container":
+
+ + + + +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/Pills.tsx comment pills should render when no comments 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + +
+
+ , + "container":
+
+ + + +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/Pills.tsx label pills should render labels pill 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + + + +
+
+ , + "container":
+
+ + + + + +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/Pills.tsx linked issue pills should render issues pill when linked to multiple issues/prs 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + +
+
+ , + "container":
+
+ + + +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/Pills.tsx linked issue pills should render issues pill when linked to one issue/pr 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + +
+
+ , + "container":
+
+ + + +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/Pills.tsx milestone pills should render closed milestone pill 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + + + + +
+
+ , + "container":
+
+ + + + + + +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/Pills.tsx milestone pills should render open milestone pill 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+ + + + + + +
+
+ , + "container":
+
+ + + + + + +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/Pills.tsx showPills disabled should not render any pills when showPills is disabled 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+ , + "container":
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap new file mode 100644 index 000000000..b76db14d9 --- /dev/null +++ b/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap @@ -0,0 +1,1621 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renderer/components/notifications/RepositoryNotifications.tsx should render itself & its children 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+ + + +
+
+
+ + + + + + +
+
+
+
+ NotificationRow +
+
+ NotificationRow +
+
+ , + "container":
+
+
+ + + +
+
+
+ + + + + + +
+
+
+
+ NotificationRow +
+
+ NotificationRow +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/RepositoryNotifications.tsx should toggle repository notifications visibility 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+ + + +
+
+
+ + + + + + +
+
+
+
+
+
+
+ + + +
+
+
+ + + + + + +
+
+
+
+ NotificationRow +
+
+ NotificationRow +
+
+ , + "container":
+
+
+ + + +
+
+
+ + + + + + +
+
+
+
+ NotificationRow +
+
+ NotificationRow +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; + +exports[`renderer/components/notifications/RepositoryNotifications.tsx should use default repository icon when avatar is not available 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+ + + +
+
+
+ + + + + + +
+
+
+
+ NotificationRow +
+
+ NotificationRow +
+
+ , + "container":
+
+
+ + + +
+
+
+ + + + + + +
+
+
+
+ NotificationRow +
+
+ NotificationRow +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/src/renderer/components/primitives/Centered.test.tsx b/src/renderer/components/primitives/Centered.test.tsx new file mode 100644 index 000000000..58a7b92e7 --- /dev/null +++ b/src/renderer/components/primitives/Centered.test.tsx @@ -0,0 +1,10 @@ +import { render } from '@testing-library/react'; +import { Centered } from './Centered'; + +describe('renderer/components/primitives/Centered.tsx', () => { + it('should render itself & its children', () => { + const tree = render(Test); + + expect(tree).toMatchSnapshot(); + }); +}); diff --git a/src/renderer/components/primitives/Centered.tsx b/src/renderer/components/primitives/Centered.tsx new file mode 100644 index 000000000..326c7fe57 --- /dev/null +++ b/src/renderer/components/primitives/Centered.tsx @@ -0,0 +1,13 @@ +import type { FC, ReactNode } from 'react'; + +interface ICentered { + children: ReactNode; +} + +export const Centered: FC = (props: ICentered) => { + return ( +
+ {props.children} +
+ ); +}; diff --git a/src/renderer/components/EmojiText.test.tsx b/src/renderer/components/primitives/EmojiText.test.tsx similarity index 82% rename from src/renderer/components/EmojiText.test.tsx rename to src/renderer/components/primitives/EmojiText.test.tsx index 3104f8d44..d5cdbcc84 100644 --- a/src/renderer/components/EmojiText.test.tsx +++ b/src/renderer/components/primitives/EmojiText.test.tsx @@ -1,7 +1,7 @@ import { render } from '@testing-library/react'; import { EmojiText, type IEmojiText } from './EmojiText'; -describe('renderer/components/Emoji.tsx', () => { +describe('renderer/components/primitives/Emoji.tsx', () => { it('should render', () => { const props: IEmojiText = { text: '🍺', diff --git a/src/renderer/components/EmojiText.tsx b/src/renderer/components/primitives/EmojiText.tsx similarity index 84% rename from src/renderer/components/EmojiText.tsx rename to src/renderer/components/primitives/EmojiText.tsx index c75362566..ef076212c 100644 --- a/src/renderer/components/EmojiText.tsx +++ b/src/renderer/components/primitives/EmojiText.tsx @@ -1,5 +1,6 @@ import { type FC, useEffect, useRef } from 'react'; -import { convertTextToEmojiImgHtml } from '../utils/emojis'; + +import { convertTextToEmojiImgHtml } from '../../utils/emojis'; export interface IEmojiText { text: string; diff --git a/src/renderer/components/Header.test.tsx b/src/renderer/components/primitives/Header.test.tsx similarity index 83% rename from src/renderer/components/Header.test.tsx rename to src/renderer/components/primitives/Header.test.tsx index c4f2cb779..0a2eececb 100644 --- a/src/renderer/components/Header.test.tsx +++ b/src/renderer/components/primitives/Header.test.tsx @@ -1,6 +1,6 @@ import { MarkGithubIcon } from '@primer/octicons-react'; import { fireEvent, render, screen } from '@testing-library/react'; -import { AppContext } from '../context/App'; +import { AppContext } from '../../context/App'; import { Header } from './Header'; const mockNavigate = jest.fn(); @@ -9,7 +9,7 @@ jest.mock('react-router-dom', () => ({ useNavigate: () => mockNavigate, })); -describe('renderer/components/Header.tsx', () => { +describe('renderer/components/primitives/Header.tsx', () => { const fetchNotifications = jest.fn(); afterEach(() => { @@ -25,7 +25,7 @@ describe('renderer/components/Header.tsx', () => { it('should navigate back', () => { render(
Test Header
); - fireEvent.click(screen.getByLabelText('Go Back')); + fireEvent.click(screen.getByTestId('header-nav-back')); expect(mockNavigate).toHaveBeenNthCalledWith(1, -1); }); @@ -43,7 +43,7 @@ describe('renderer/components/Header.tsx', () => { , ); - fireEvent.click(screen.getByLabelText('Go Back')); + fireEvent.click(screen.getByTestId('header-nav-back')); expect(mockNavigate).toHaveBeenNthCalledWith(1, -1); expect(fetchNotifications).toHaveBeenCalledTimes(1); diff --git a/src/renderer/components/primitives/Header.tsx b/src/renderer/components/primitives/Header.tsx new file mode 100644 index 000000000..80fbb9687 --- /dev/null +++ b/src/renderer/components/primitives/Header.tsx @@ -0,0 +1,51 @@ +import { type FC, useContext } from 'react'; +import { useNavigate } from 'react-router-dom'; + +import { ArrowLeftIcon, type Icon } from '@primer/octicons-react'; + +import { Heading, IconButton, Octicon, Stack } from '@primer/react'; +import { AppContext } from '../../context/App'; +import { Size } from '../../types'; + +interface IHeader { + icon: Icon; + children: string; + fetchOnBack?: boolean; +} + +export const Header: FC = (props: IHeader) => { + const navigate = useNavigate(); + + const { fetchNotifications } = useContext(AppContext); + + return ( +
+ + { + navigate(-1); + if (props.fetchOnBack) { + fetchNotifications(); + } + }} + data-testid="header-nav-back" + /> + + + + + {props.children} + + + +
+ ); +}; diff --git a/src/renderer/components/HoverGroup.test.tsx b/src/renderer/components/primitives/HoverGroup.test.tsx similarity index 77% rename from src/renderer/components/HoverGroup.test.tsx rename to src/renderer/components/primitives/HoverGroup.test.tsx index 76fce6cbf..582ac2af9 100644 --- a/src/renderer/components/HoverGroup.test.tsx +++ b/src/renderer/components/primitives/HoverGroup.test.tsx @@ -1,7 +1,7 @@ import { render } from '@testing-library/react'; import { HoverGroup } from './HoverGroup'; -describe('renderer/components/HoverGroup.tsx', () => { +describe('renderer/components/primitives/HoverGroup.tsx', () => { it('should render', () => { const tree = render(Hover Group); expect(tree).toMatchSnapshot(); diff --git a/src/renderer/components/primitives/HoverGroup.tsx b/src/renderer/components/primitives/HoverGroup.tsx new file mode 100644 index 000000000..01df53990 --- /dev/null +++ b/src/renderer/components/primitives/HoverGroup.tsx @@ -0,0 +1,17 @@ +import type { FC, ReactNode } from 'react'; + +import { Stack } from '@primer/react'; + +interface IHoverGroup { + children: ReactNode; +} + +export const HoverGroup: FC = ({ children }: IHoverGroup) => { + return ( +
+ + {children} + +
+ ); +}; diff --git a/src/renderer/components/settings/Legend.test.tsx b/src/renderer/components/primitives/Legend.test.tsx similarity index 82% rename from src/renderer/components/settings/Legend.test.tsx rename to src/renderer/components/primitives/Legend.test.tsx index 90e515141..4a154d36a 100644 --- a/src/renderer/components/settings/Legend.test.tsx +++ b/src/renderer/components/primitives/Legend.test.tsx @@ -2,7 +2,7 @@ import { PersonFillIcon } from '@primer/octicons-react'; import { render } from '@testing-library/react'; import { Legend } from './Legend'; -describe('renderer/routes/components/settings/Legend.tsx', () => { +describe('renderer/routes/components/primitives/Legend.tsx', () => { it('should render the legend', async () => { const { container } = render(Legend); diff --git a/src/renderer/components/settings/Legend.tsx b/src/renderer/components/primitives/Legend.tsx similarity index 99% rename from src/renderer/components/settings/Legend.tsx rename to src/renderer/components/primitives/Legend.tsx index b3eecc494..788b4f88b 100644 --- a/src/renderer/components/settings/Legend.tsx +++ b/src/renderer/components/primitives/Legend.tsx @@ -1,6 +1,7 @@ -import type { Icon } from '@primer/octicons-react'; import type { FC } from 'react'; +import type { Icon } from '@primer/octicons-react'; + interface ILegend { icon: Icon; children: string; diff --git a/src/renderer/components/__snapshots__/HoverGroup.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Centered.test.tsx.snap similarity index 85% rename from src/renderer/components/__snapshots__/HoverGroup.test.tsx.snap rename to src/renderer/components/primitives/__snapshots__/Centered.test.tsx.snap index e0b666c28..584b4f019 100644 --- a/src/renderer/components/__snapshots__/HoverGroup.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/Centered.test.tsx.snap @@ -1,22 +1,22 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/HoverGroup.tsx should render 1`] = ` +exports[`renderer/components/primitives/Centered.tsx should render itself & its children 1`] = ` { "asFragment": [Function], "baseElement":
- Hover Group + Test
, "container":
- Hover Group + Test
, "debug": [Function], diff --git a/src/renderer/components/__snapshots__/EmojiText.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/EmojiText.test.tsx.snap similarity index 96% rename from src/renderer/components/__snapshots__/EmojiText.test.tsx.snap rename to src/renderer/components/primitives/__snapshots__/EmojiText.test.tsx.snap index a2f5e0b2e..a890b34c8 100644 --- a/src/renderer/components/__snapshots__/EmojiText.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/EmojiText.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/Emoji.tsx should render 1`] = ` +exports[`renderer/components/primitives/Emoji.tsx should render 1`] = ` { "asFragment": [Function], "baseElement": diff --git a/src/renderer/components/__snapshots__/Header.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap similarity index 55% rename from src/renderer/components/__snapshots__/Header.test.tsx.snap rename to src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap index 57603f895..bd9677fa2 100644 --- a/src/renderer/components/__snapshots__/Header.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap @@ -1,110 +1,168 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/components/Header.tsx should render itself & its children 1`] = ` +exports[`renderer/components/primitives/Header.tsx should render itself & its children 1`] = ` { "asFragment": [Function], "baseElement":
- -

- + + +
+ - Test Header - -

+

+ Test Header +

+
+
, "container":
- -

- + + +
+ - Test Header - -

+

+ Test Header +

+
+
, "debug": [Function], diff --git a/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap new file mode 100644 index 000000000..cae4f375d --- /dev/null +++ b/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap @@ -0,0 +1,94 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renderer/components/primitives/HoverGroup.tsx should render 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
+
+
+ Hover Group +
+
+
+ , + "container":
+
+
+ Hover Group +
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} +`; diff --git a/src/renderer/components/settings/__snapshots__/Legend.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Legend.test.tsx.snap similarity index 87% rename from src/renderer/components/settings/__snapshots__/Legend.test.tsx.snap rename to src/renderer/components/primitives/__snapshots__/Legend.test.tsx.snap index 6b4b5e90e..a8f1e5bf5 100644 --- a/src/renderer/components/settings/__snapshots__/Legend.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/Legend.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renderer/routes/components/settings/Legend.tsx should render the legend 1`] = ` +exports[`renderer/routes/components/primitives/Legend.tsx should render the legend 1`] = `
{ }); await act(async () => { - fireEvent.click(screen.getByLabelText('Zoom Out')); + fireEvent.click(screen.getByTestId('settings-zoom-out')); await zoomTimeout(); }); @@ -98,7 +98,7 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { expect(updateSetting).toHaveBeenCalledWith('zoomPercentage', 90); await act(async () => { - fireEvent.click(screen.getByLabelText('Zoom Out')); + fireEvent.click(screen.getByTestId('settings-zoom-out')); await zoomTimeout(); expect(updateSetting).toHaveBeenCalledTimes(2); @@ -106,7 +106,7 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { }); await act(async () => { - fireEvent.click(screen.getByLabelText('Zoom In')); + fireEvent.click(screen.getByTestId('settings-zoom-in')); await zoomTimeout(); expect(updateSetting).toHaveBeenCalledTimes(3); @@ -114,7 +114,7 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { }); await act(async () => { - fireEvent.click(screen.getByLabelText('Reset Zoom')); + fireEvent.click(screen.getByTestId('settings-zoom-reset')); await zoomTimeout(); expect(updateSetting).toHaveBeenCalledTimes(4); @@ -139,8 +139,6 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { ); }); - await screen.findByLabelText('Detailed notifications'); - fireEvent.click(screen.getByLabelText('Detailed notifications')); expect(updateSetting).toHaveBeenCalledTimes(1); @@ -164,8 +162,6 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { ); }); - await screen.findByLabelText('Show notification metric pills'); - fireEvent.click(screen.getByLabelText('Show notification metric pills')); expect(updateSetting).toHaveBeenCalledTimes(1); @@ -189,8 +185,6 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { ); }); - await screen.findByLabelText('Show number'); - fireEvent.click(screen.getByLabelText('Show number')); expect(updateSetting).toHaveBeenCalledTimes(1); @@ -216,8 +210,6 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { ); }); - await screen.findByLabelText('Show account header'); - fireEvent.click(screen.getByLabelText('Show account header')); expect(updateSetting).toHaveBeenCalledTimes(1); diff --git a/src/renderer/components/settings/AppearanceSettings.tsx b/src/renderer/components/settings/AppearanceSettings.tsx index 1014776b4..a7edbd5ad 100644 --- a/src/renderer/components/settings/AppearanceSettings.tsx +++ b/src/renderer/components/settings/AppearanceSettings.tsx @@ -1,28 +1,35 @@ +import { ipcRenderer, webFrame } from 'electron'; +import { type FC, useContext, useEffect, useState } from 'react'; + import { CheckIcon, CommentIcon, + DashIcon, GitPullRequestIcon, IssueClosedIcon, MilestoneIcon, PaintbrushIcon, + PlusIcon, TagIcon, + XCircleIcon, } from '@primer/octicons-react'; -import { ipcRenderer, webFrame } from 'electron'; -import { type FC, useContext, useEffect, useState } from 'react'; +import { Button, ButtonGroup, Tooltip, useTheme } from '@primer/react'; +import type { ColorModeWithAuto } from '@primer/react/lib/ThemeProvider'; + import { AppContext } from '../../context/App'; import { Size, Theme } from '../../types'; import { hasMultipleAccounts } from '../../utils/auth/utils'; import { setTheme } from '../../utils/theme'; import { zoomLevelToPercentage, zoomPercentageToLevel } from '../../utils/zoom'; -import { Button } from '../buttons/Button'; import { Checkbox } from '../fields/Checkbox'; import { RadioGroup } from '../fields/RadioGroup'; -import { Legend } from './Legend'; +import { Legend } from '../primitives/Legend'; let timeout: NodeJS.Timeout; const DELAY = 200; export const AppearanceSettings: FC = () => { + const { setColorMode } = useTheme(); const { auth, settings, updateSetting } = useContext(AppContext); const [zoomPercentage, setZoomPercentage] = useState( zoomLevelToPercentage(webFrame.getZoomLevel()), @@ -32,9 +39,10 @@ export const AppearanceSettings: FC = () => { ipcRenderer.on('gitify:update-theme', (_, updatedTheme: Theme) => { if (settings.theme === Theme.SYSTEM) { setTheme(updatedTheme); + setColorMode(updatedTheme === Theme.LIGHT ? 'light' : 'dark'); } }); - }, [settings.theme]); + }, [settings.theme, setColorMode]); window.addEventListener('resize', () => { // clear the timeout @@ -50,6 +58,7 @@ export const AppearanceSettings: FC = () => { return (
Appearance + { { label: 'Dark', value: Theme.DARK }, ]} onChange={(evt) => { + let mode: ColorModeWithAuto; + switch (evt.target.value) { + case Theme.LIGHT: + mode = 'day'; + break; + case Theme.DARK: + mode = 'night'; + break; + default: + mode = 'auto'; + break; + } + updateSetting('theme', evt.target.value as Theme); + + setColorMode(mode); + setTheme(evt.target.value as Theme); }} /> +
- - - {zoomPercentage.toFixed(0)}% - - - + + + + + + + + + +
+ {
} /> + { } /> + { } /> + { const { settings, updateSetting } = useContext(AppContext); diff --git a/src/renderer/components/settings/SettingsFooter.test.tsx b/src/renderer/components/settings/SettingsFooter.test.tsx index 84c09220a..0f301d72e 100644 --- a/src/renderer/components/settings/SettingsFooter.test.tsx +++ b/src/renderer/components/settings/SettingsFooter.test.tsx @@ -46,7 +46,7 @@ describe('renderer/routes/components/settings/SettingsFooter.tsx', () => { ); }); - expect(screen.getByLabelText('app-version')).toMatchSnapshot(); + expect(screen.getByTestId('settings-release-notes')).toMatchSnapshot(); }); it('should show development app version', async () => { @@ -70,7 +70,7 @@ describe('renderer/routes/components/settings/SettingsFooter.tsx', () => { ); }); - expect(screen.getByLabelText('app-version')).toMatchSnapshot(); + expect(screen.getByTestId('settings-release-notes')).toMatchSnapshot(); }); }); @@ -98,7 +98,7 @@ describe('renderer/routes/components/settings/SettingsFooter.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('View release notes')); + fireEvent.click(screen.getByTestId('settings-release-notes')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); expect(openExternalLinkMock).toHaveBeenCalledWith( @@ -122,7 +122,8 @@ describe('renderer/routes/components/settings/SettingsFooter.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Accounts')); + fireEvent.click(screen.getByTestId('settings-accounts')); + expect(mockNavigate).toHaveBeenCalledWith('/accounts'); }); @@ -144,7 +145,8 @@ describe('renderer/routes/components/settings/SettingsFooter.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Quit Gitify')); + fireEvent.click(screen.getByTestId('settings-quit')); + expect(quitAppMock).toHaveBeenCalledTimes(1); }); }); diff --git a/src/renderer/components/settings/SettingsFooter.tsx b/src/renderer/components/settings/SettingsFooter.tsx index a5fd609a4..ba7f0fa16 100644 --- a/src/renderer/components/settings/SettingsFooter.tsx +++ b/src/renderer/components/settings/SettingsFooter.tsx @@ -1,8 +1,9 @@ -import { PersonIcon, XCircleIcon } from '@primer/octicons-react'; import { type FC, useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; -import { BUTTON_CLASS_NAME } from '../../styles/gitify'; -import { Size } from '../../types'; + +import { PersonIcon, XCircleIcon } from '@primer/octicons-react'; +import { Button, IconButton, Stack, Tooltip } from '@primer/react'; + import { getAppVersion, quitApp } from '../../utils/comms'; import { openGitifyReleaseNotes } from '../../utils/links'; @@ -22,38 +23,42 @@ export const SettingsFooter: FC = () => { }, []); return ( -
- -
- +
+ + + + + + + + + { + navigate('/accounts'); + }} + data-testid="settings-accounts" + /> + - -
+ + { + quitApp(); + }} + data-testid="settings-quit" + /> + +
); }; diff --git a/src/renderer/components/settings/SystemSettings.tsx b/src/renderer/components/settings/SystemSettings.tsx index 9a6750558..e4056db26 100644 --- a/src/renderer/components/settings/SystemSettings.tsx +++ b/src/renderer/components/settings/SystemSettings.tsx @@ -1,12 +1,14 @@ -import { DeviceDesktopIcon } from '@primer/octicons-react'; import { type FC, useContext } from 'react'; + +import { DeviceDesktopIcon } from '@primer/octicons-react'; + import { AppContext } from '../../context/App'; import { OpenPreference } from '../../types'; import { Constants } from '../../utils/constants'; import { isLinux, isMacOS } from '../../utils/platform'; import { Checkbox } from '../fields/Checkbox'; import { RadioGroup } from '../fields/RadioGroup'; -import { Legend } from './Legend'; +import { Legend } from '../primitives/Legend'; export const SystemSettings: FC = () => { const { settings, updateSetting } = useContext(AppContext); diff --git a/src/renderer/components/settings/__snapshots__/SettingsFooter.test.tsx.snap b/src/renderer/components/settings/__snapshots__/SettingsFooter.test.tsx.snap index 5cbe87385..a65ca6ba9 100644 --- a/src/renderer/components/settings/__snapshots__/SettingsFooter.test.tsx.snap +++ b/src/renderer/components/settings/__snapshots__/SettingsFooter.test.tsx.snap @@ -1,19 +1,51 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renderer/routes/components/settings/SettingsFooter.tsx app version should show development app version 1`] = ` - - Gitify - dev - + + + Gitify + dev + + + `; exports[`renderer/routes/components/settings/SettingsFooter.tsx app version should show production app version 1`] = ` - - Gitify - v0.0.1 - + + + Gitify + v0.0.1 + + + `; diff --git a/src/renderer/context/App.tsx b/src/renderer/context/App.tsx index 3322430fb..cee55cfed 100644 --- a/src/renderer/context/App.tsx +++ b/src/renderer/context/App.tsx @@ -7,6 +7,7 @@ import { useMemo, useState, } from 'react'; + import { useInterval } from '../hooks/useInterval'; import { useNotifications } from '../hooks/useNotifications'; import { @@ -45,7 +46,6 @@ import { import { Constants } from '../utils/constants'; import { getNotificationCount } from '../utils/notifications'; import { clearState, loadState, saveState } from '../utils/storage'; -import { setTheme } from '../utils/theme'; import { zoomPercentageToLevel } from '../utils/zoom'; export const defaultAuth: AuthState = { @@ -138,10 +138,6 @@ export const AppProvider = ({ children }: { children: ReactNode }) => { restoreSettings(); }, []); - useEffect(() => { - setTheme(settings.theme); - }, [settings.theme]); - // biome-ignore lint/correctness/useExhaustiveDependencies: We only want fetchNotifications to be called for account changes useEffect(() => { fetchNotifications({ auth, settings }); diff --git a/src/renderer/routes/Accounts.test.tsx b/src/renderer/routes/Accounts.test.tsx index e2b23052f..a5a1b6cbb 100644 --- a/src/renderer/routes/Accounts.test.tsx +++ b/src/renderer/routes/Accounts.test.tsx @@ -6,6 +6,9 @@ import { waitFor, } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; + +import { BaseStyles, ThemeProvider } from '@primer/react'; + import { mockAuth, mockGitHubAppAccount, @@ -17,7 +20,6 @@ import { AppContext } from '../context/App'; import * as apiRequests from '../utils/api/request'; import * as comms from '../utils/comms'; import * as links from '../utils/links'; - import { AccountsRoute } from './Accounts'; const mockNavigate = jest.fn(); @@ -73,7 +75,7 @@ describe('renderer/routes/Accounts.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Go Back')); + fireEvent.click(screen.getByTestId('header-nav-back')); expect(mockNavigate).toHaveBeenNthCalledWith(1, -1); }); }); @@ -101,7 +103,7 @@ describe('renderer/routes/Accounts.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Open Profile')); + fireEvent.click(screen.getByTestId('account-profile')); expect(openAccountProfileMock).toHaveBeenCalledTimes(1); expect(openAccountProfileMock).toHaveBeenCalledWith( @@ -131,7 +133,7 @@ describe('renderer/routes/Accounts.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Open Host')); + fireEvent.click(screen.getByTestId('account-host')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); expect(openExternalLinkMock).toHaveBeenCalledWith('https://github.com'); @@ -159,7 +161,7 @@ describe('renderer/routes/Accounts.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Open Developer Settings')); + fireEvent.click(screen.getByTestId('account-developer-settings')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); expect(openExternalLinkMock).toHaveBeenCalledWith( @@ -187,7 +189,7 @@ describe('renderer/routes/Accounts.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Refresh octocat')); + fireEvent.click(screen.getByTestId('account-refresh')); expect(apiRequestAuthMock).toHaveBeenCalledTimes(1); expect(apiRequestAuthMock).toHaveBeenCalledWith( @@ -225,7 +227,7 @@ describe('renderer/routes/Accounts.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Logout octocat')); + fireEvent.click(screen.getByTestId('account-logout')); expect(logoutFromAccountMock).toHaveBeenCalledTimes(1); @@ -243,21 +245,26 @@ describe('renderer/routes/Accounts.tsx', () => { await act(async () => { render( - - - - - , + + + + + + + + + , ); }); - fireEvent.click(screen.getByTitle('Login with GitHub')); + fireEvent.click(screen.getByTestId('account-add-new')); + fireEvent.click(screen.getByTestId('account-add-github')); expect(mockLoginWithGitHubApp).toHaveBeenCalled(); }); @@ -265,20 +272,25 @@ describe('renderer/routes/Accounts.tsx', () => { it('should show login with personal access token', async () => { await act(async () => { render( - - - - - , + + + + + + + + + , ); }); - fireEvent.click(screen.getByTitle('Login with Personal Access Token')); + fireEvent.click(screen.getByTestId('account-add-new')); + fireEvent.click(screen.getByTestId('account-add-pat')); expect(mockNavigate).toHaveBeenNthCalledWith( 1, @@ -292,20 +304,25 @@ describe('renderer/routes/Accounts.tsx', () => { it('should show login with oauth app', async () => { await act(async () => { render( - - - - - , + + + + + + + + + , ); }); - fireEvent.click(screen.getByTitle('Login with OAuth App')); + fireEvent.click(screen.getByTestId('account-add-new')); + fireEvent.click(screen.getByTestId('account-add-oauth-app')); expect(mockNavigate).toHaveBeenNthCalledWith(1, '/login-oauth-app', { replace: true, diff --git a/src/renderer/routes/Accounts.tsx b/src/renderer/routes/Accounts.tsx index e906ce1a9..6782d3b54 100644 --- a/src/renderer/routes/Accounts.tsx +++ b/src/renderer/routes/Accounts.tsx @@ -1,28 +1,34 @@ +import log from 'electron-log'; +import { type FC, useCallback, useContext } from 'react'; +import { useNavigate } from 'react-router-dom'; + import { - FeedPersonIcon, KeyIcon, MarkGithubIcon, + PersonAddIcon, PersonIcon, - PlusIcon, SignOutIcon, StarFillIcon, StarIcon, SyncIcon, } from '@primer/octicons-react'; +import { + ActionList, + ActionMenu, + Avatar, + Button, + IconButton, + Stack, + Text, + Tooltip, +} from '@primer/react'; -import log from 'electron-log'; -import { type FC, useCallback, useContext } from 'react'; -import { useNavigate } from 'react-router-dom'; -import { Header } from '../components/Header'; -import { AuthMethodIcon } from '../components/icons/AuthMethodIcon'; -import { AvatarIcon } from '../components/icons/AvatarIcon'; -import { PlatformIcon } from '../components/icons/PlatformIcon'; +import { Header } from '../components/primitives/Header'; import { AppContext } from '../context/App'; -import { BUTTON_CLASS_NAME } from '../styles/gitify'; -import { type Account, IconColor, Size } from '../types'; +import { type Account, Size } from '../types'; import { getAccountUUID, refreshAccount } from '../utils/auth/utils'; -import { cn } from '../utils/cn'; import { updateTrayIcon, updateTrayTitle } from '../utils/comms'; +import { getAuthMethodIcon, getPlatformIcon } from '../utils/icons'; import { openAccountProfile, openDeveloperSettings, @@ -71,152 +77,142 @@ export const AccountsRoute: FC = () => {
Accounts
-
- {auth.accounts.map((account, i) => ( -
-
-
- -
-
- -
-
- -
-
-
- - - - + + + @{account.user.login} + + ({account.user?.name}) + + + + + + + + + + openHost(account.hostname)} + data-testid="account-host" + > + + + + {account.hostname} + + + + + openDeveloperSettings(account)} + data-testid="account-developer-settings" + > + + + + {account.method} + + + + + + + setAsPrimaryAccount(account)} + data-testid="account-set-primary" + /> + { + await refreshAccount(account); + navigate('/accounts', { replace: true }); + }} + data-testid="account-refresh" + /> + logoutAccount(account)} + data-testid="account-logout" + /> + + +
-
- ))} + ); + })}
-
-
Add new account
-
- - - -
+
+ + + + + + + + loginWithGitHub()} + data-testid="account-add-github" + > + + + + Login with GitHub + + + loginWithPersonalAccessToken()} + data-testid="account-add-pat" + > + + + + Login with Personal Access Token + + + loginWithOAuthApp()} + data-testid="account-add-oauth-app" + > + + + + Login with OAuth App + + + +
); diff --git a/src/renderer/routes/Filters.test.tsx b/src/renderer/routes/Filters.test.tsx index c84959e74..d023bb970 100644 --- a/src/renderer/routes/Filters.test.tsx +++ b/src/renderer/routes/Filters.test.tsx @@ -53,11 +53,12 @@ describe('renderer/routes/Filters.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Go Back')); + fireEvent.click(screen.getByTestId('header-nav-back')); expect(fetchNotifications).toHaveBeenCalledTimes(1); expect(mockNavigate).toHaveBeenNthCalledWith(1, -1); }); }); + describe('Users section', () => { it('should not be able to toggle the hideBots checkbox when detailedNotifications is disabled', async () => { await act(async () => { @@ -227,7 +228,7 @@ describe('renderer/routes/Filters.tsx', () => { ); }); - fireEvent.click(screen.getByTitle('Clear filters')); + fireEvent.click(screen.getByTestId('filters-clear')); expect(clearFilters).toHaveBeenCalled(); }); diff --git a/src/renderer/routes/Filters.tsx b/src/renderer/routes/Filters.tsx index fe07e33c5..4c8ec24c1 100644 --- a/src/renderer/routes/Filters.tsx +++ b/src/renderer/routes/Filters.tsx @@ -1,16 +1,17 @@ +import { type FC, useContext } from 'react'; + import { FeedPersonIcon, FilterIcon, FilterRemoveIcon, NoteIcon, } from '@primer/octicons-react'; -import { type FC, useContext } from 'react'; -import { Header } from '../components/Header'; +import { Button, Tooltip } from '@primer/react'; + import { Checkbox } from '../components/fields/Checkbox'; -import { Legend } from '../components/settings/Legend'; +import { Header } from '../components/primitives/Header'; +import { Legend } from '../components/primitives/Legend'; import { AppContext } from '../context/App'; -import { BUTTON_CLASS_NAME } from '../styles/gitify'; -import { Size } from '../types'; import type { Reason } from '../typesGitHub'; import { FORMATTED_REASONS, formatReason } from '../utils/reason'; @@ -68,7 +69,7 @@ export const FiltersRoute: FC = () => {
Reason - Note: if no reasons are selected, all notifications will be shown. + Note: If no reasons are selected, all notifications will be shown. {Object.keys(FORMATTED_REASONS).map((reason: Reason) => { return ( @@ -87,22 +88,16 @@ export const FiltersRoute: FC = () => {
-
-
- -
+ +
); diff --git a/src/renderer/routes/Login.test.tsx b/src/renderer/routes/Login.test.tsx index 9792e7f96..5f83e6c32 100644 --- a/src/renderer/routes/Login.test.tsx +++ b/src/renderer/routes/Login.test.tsx @@ -63,7 +63,7 @@ describe('renderer/routes/Login.tsx', () => { , ); - fireEvent.click(screen.getByLabelText('Login with GitHub')); + fireEvent.click(screen.getByTestId('login-github')); expect(mockLoginWithGitHubApp).toHaveBeenCalled(); }); @@ -75,7 +75,7 @@ describe('renderer/routes/Login.tsx', () => { , ); - fireEvent.click(screen.getByLabelText('Login with Personal Access Token')); + fireEvent.click(screen.getByTestId('login-pat')); expect(mockNavigate).toHaveBeenNthCalledWith( 1, @@ -90,7 +90,7 @@ describe('renderer/routes/Login.tsx', () => { , ); - fireEvent.click(screen.getByLabelText('Login with OAuth App')); + fireEvent.click(screen.getByTestId('login-oauth-app')); expect(mockNavigate).toHaveBeenNthCalledWith(1, '/login-oauth-app'); }); diff --git a/src/renderer/routes/Login.tsx b/src/renderer/routes/Login.tsx index 2a661eb67..1ed5e7ab5 100644 --- a/src/renderer/routes/Login.tsx +++ b/src/renderer/routes/Login.tsx @@ -1,9 +1,12 @@ -import { KeyIcon, MarkGithubIcon, PersonIcon } from '@primer/octicons-react'; import log from 'electron-log'; import { type FC, useCallback, useContext, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; -import { Button } from '../components/buttons/Button'; + +import { KeyIcon, MarkGithubIcon, PersonIcon } from '@primer/octicons-react'; +import { Button, Heading, Stack, Text } from '@primer/react'; + import { LogoIcon } from '../components/icons/LogoIcon'; +import { Centered } from '../components/primitives/Centered'; import { AppContext } from '../context/App'; import { Size } from '../types'; import { showWindow } from '../utils/comms'; @@ -19,50 +22,65 @@ export const LoginRoute: FC = () => { } }, [isLoggedIn]); - const loginUser = useCallback(async () => { + const loginUser = useCallback(() => { try { - await loginWithGitHubApp(); + loginWithGitHubApp(); } catch (err) { log.error('Auth: failed to login with GitHub', err); } }, [loginWithGitHubApp]); return ( -
- + + + + + + + GitHub Notifications + + + on your menu bar + + -
- GitHub Notifications
on your menu bar. -
+ + Login with -
Login with
+ - + - - -
+ + + + ); }; diff --git a/src/renderer/routes/LoginWithOAuthApp.test.tsx b/src/renderer/routes/LoginWithOAuthApp.test.tsx index c47eca294..7a8c6b9dd 100644 --- a/src/renderer/routes/LoginWithOAuthApp.test.tsx +++ b/src/renderer/routes/LoginWithOAuthApp.test.tsx @@ -47,7 +47,8 @@ describe('renderer/routes/LoginWithOAuthApp.tsx', () => { , ); - fireEvent.click(screen.getByLabelText('Go Back')); + fireEvent.click(screen.getByTestId('header-nav-back')); + expect(mockNavigate).toHaveBeenNthCalledWith(1, -1); }); @@ -86,7 +87,7 @@ describe('renderer/routes/LoginWithOAuthApp.tsx', () => { , ); - fireEvent.click(screen.getByText('Create new OAuth App')); + fireEvent.click(screen.getByTestId('login-create-oauth-app')); expect(openExternalLinkMock).toHaveBeenCalledTimes(0); }); @@ -104,7 +105,7 @@ describe('renderer/routes/LoginWithOAuthApp.tsx', () => { target: { value: 'company.github.com' }, }); - fireEvent.click(screen.getByText('Create new OAuth App')); + fireEvent.click(screen.getByTestId('login-create-oauth-app')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); }); @@ -135,7 +136,7 @@ describe('renderer/routes/LoginWithOAuthApp.tsx', () => { target: { value: '1234567890_asdfghjklPOIUYTREWQ0987654321' }, }); - fireEvent.submit(screen.getByLabelText('Login')); + fireEvent.click(screen.getByTestId('login-submit')); await waitFor(() => expect(mockLoginWithOAuthApp).toHaveBeenCalledTimes(1)); @@ -162,7 +163,7 @@ describe('renderer/routes/LoginWithOAuthApp.tsx', () => { target: { value: 'abc' }, }); - fireEvent.submit(screen.getByLabelText('Login')); + fireEvent.click(screen.getByTestId('login-submit')); expect(screen.getByText('Invalid hostname.')).toBeTruthy(); expect(screen.getByText('Invalid client id.')).toBeTruthy(); @@ -178,7 +179,7 @@ describe('renderer/routes/LoginWithOAuthApp.tsx', () => { , ); - fireEvent.click(screen.getByLabelText('GitHub Docs')); + fireEvent.click(screen.getByTestId('login-docs')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); }); diff --git a/src/renderer/routes/LoginWithOAuthApp.tsx b/src/renderer/routes/LoginWithOAuthApp.tsx index de44218d2..943bdf1bd 100644 --- a/src/renderer/routes/LoginWithOAuthApp.tsx +++ b/src/renderer/routes/LoginWithOAuthApp.tsx @@ -1,19 +1,15 @@ -import { BookIcon, PersonIcon, SignInIcon } from '@primer/octicons-react'; import log from 'electron-log'; import { type FC, useCallback, useContext } from 'react'; import { Form, type FormRenderProps } from 'react-final-form'; import { useNavigate } from 'react-router-dom'; -import { Header } from '../components/Header'; -import { Button } from '../components/buttons/Button'; + +import { BookIcon, PersonIcon, SignInIcon } from '@primer/octicons-react'; +import { Button, Stack, Text, Tooltip } from '@primer/react'; + import { FieldInput } from '../components/fields/FieldInput'; +import { Header } from '../components/primitives/Header'; import { AppContext } from '../context/App'; -import { - type ClientID, - type ClientSecret, - type Hostname, - Size, - type Token, -} from '../types'; +import type { ClientID, ClientSecret, Hostname, Token } from '../types'; import type { LoginOAuthAppOptions } from '../utils/auth/types'; import { getNewOAuthAppURL, @@ -21,6 +17,7 @@ import { isValidHostname, isValidToken, } from '../utils/auth/utils'; +import { openExternalLink } from '../utils/comms'; import { Constants } from '../utils/constants'; interface IValues { @@ -74,19 +71,25 @@ export const LoginWithOAuthAppRoute: FC = () => { label="Hostname" placeholder="github.company.com" helpText={ -
- - on GitHub then paste your - client id and client secret below. -
+ + + + on GitHub then paste your + + + client id and client secret below. + + } /> @@ -98,29 +101,30 @@ export const LoginWithOAuthAppRoute: FC = () => { placeholder="ABC123DEF456" /> -
- - - -
+ + + + + + + + + ); }; diff --git a/src/renderer/routes/LoginWithPersonalAccessToken.test.tsx b/src/renderer/routes/LoginWithPersonalAccessToken.test.tsx index f9a74391e..16bbb5085 100644 --- a/src/renderer/routes/LoginWithPersonalAccessToken.test.tsx +++ b/src/renderer/routes/LoginWithPersonalAccessToken.test.tsx @@ -1,10 +1,4 @@ -import { - act, - fireEvent, - render, - screen, - waitFor, -} from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { AppContext } from '../context/App'; import * as comms from '../utils/comms'; @@ -46,7 +40,8 @@ describe('renderer/routes/LoginWithPersonalAccessToken.tsx', () => { , ); - fireEvent.click(screen.getByLabelText('Go Back')); + fireEvent.click(screen.getByTestId('header-nav-back')); + expect(mockNavigate).toHaveBeenNthCalledWith(1, -1); }); @@ -89,7 +84,7 @@ describe('renderer/routes/LoginWithPersonalAccessToken.tsx', () => { target: { value: '' }, }); - fireEvent.click(screen.getByText('Generate a PAT')); + fireEvent.click(screen.getByTestId('login-create-token')); expect(openExternalLinkMock).toHaveBeenCalledTimes(0); }); @@ -107,7 +102,7 @@ describe('renderer/routes/LoginWithPersonalAccessToken.tsx', () => { , ); - fireEvent.click(screen.getByText('Generate a PAT')); + fireEvent.click(screen.getByTestId('login-create-token')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); }); @@ -131,11 +126,12 @@ describe('renderer/routes/LoginWithPersonalAccessToken.tsx', () => { fireEvent.change(screen.getByLabelText('Token'), { target: { value: '1234567890123456789012345678901234567890' }, }); + fireEvent.change(screen.getByLabelText('Hostname'), { target: { value: 'github.com' }, }); - fireEvent.submit(screen.getByLabelText('Login')); + fireEvent.click(screen.getByTestId('login-submit')); await waitFor(() => expect(mockLoginWithPersonalAccessToken).toHaveBeenCalledTimes(1), @@ -160,16 +156,16 @@ describe('renderer/routes/LoginWithPersonalAccessToken.tsx', () => { , ); - act(() => { - fireEvent.change(screen.getByLabelText('Token'), { - target: { value: '1234567890123456789012345678901234567890' }, - }); - fireEvent.change(screen.getByLabelText('Hostname'), { - target: { value: 'github.com' }, - }); - fireEvent.submit(screen.getByLabelText('Login')); + fireEvent.change(screen.getByLabelText('Token'), { + target: { value: '1234567890123456789012345678901234567890' }, + }); + + fireEvent.change(screen.getByLabelText('Hostname'), { + target: { value: 'github.com' }, }); + fireEvent.click(screen.getByTestId('login-submit')); + await waitFor(() => expect(mockLoginWithPersonalAccessToken).toHaveBeenCalledTimes(1), ); @@ -192,7 +188,7 @@ describe('renderer/routes/LoginWithPersonalAccessToken.tsx', () => { target: { value: '123' }, }); - fireEvent.submit(screen.getByLabelText('Login')); + fireEvent.click(screen.getByTestId('login-submit')); expect(screen.getByText('Invalid hostname.')).toBeDefined(); expect(screen.getByText('Invalid token.')).toBeDefined(); @@ -211,7 +207,7 @@ describe('renderer/routes/LoginWithPersonalAccessToken.tsx', () => { , ); - fireEvent.click(screen.getByLabelText('GitHub Docs')); + fireEvent.click(screen.getByTestId('login-docs')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); }); diff --git a/src/renderer/routes/LoginWithPersonalAccessToken.tsx b/src/renderer/routes/LoginWithPersonalAccessToken.tsx index cebc284fd..12fdaa652 100644 --- a/src/renderer/routes/LoginWithPersonalAccessToken.tsx +++ b/src/renderer/routes/LoginWithPersonalAccessToken.tsx @@ -1,19 +1,22 @@ -import { BookIcon, KeyIcon, SignInIcon } from '@primer/octicons-react'; import log from 'electron-log'; import { type FC, useCallback, useContext, useState } from 'react'; import { Form, type FormRenderProps } from 'react-final-form'; import { useNavigate } from 'react-router-dom'; -import { Header } from '../components/Header'; -import { Button } from '../components/buttons/Button'; + +import { BookIcon, KeyIcon, SignInIcon } from '@primer/octicons-react'; +import { Button, Stack, Text, Tooltip } from '@primer/react'; + import { FieldInput } from '../components/fields/FieldInput'; +import { Header } from '../components/primitives/Header'; import { AppContext } from '../context/App'; -import { type Hostname, Size, type Token } from '../types'; +import type { Hostname, Token } from '../types'; import type { LoginPersonalAccessTokenOptions } from '../utils/auth/types'; import { getNewTokenURL, isValidHostname, isValidToken, } from '../utils/auth/utils'; +import { openExternalLink } from '../utils/comms'; import { Constants } from '../utils/constants'; interface IValues { @@ -59,63 +62,64 @@ export const LoginWithPersonalAccessTokenRoute: FC = () => { label="Hostname" placeholder="github.company.com" helpText={ -
-
+ + Change only if you are using GitHub Enterprise Server. -
-
+ + - - on GitHub then paste your{' '} - token below. - -
-
+ on GitHub then paste your token below. + + The required scopes will be automatically selected for you. -
-
+ + } /> - - {!isValidToken && (
This token could not be validated with {values.hostname}.
)} + + + + -
- - -
+ + + +
); }; diff --git a/src/renderer/routes/Notifications.test.tsx b/src/renderer/routes/Notifications.test.tsx index 2a2d7ecfa..f18b7c416 100644 --- a/src/renderer/routes/Notifications.test.tsx +++ b/src/renderer/routes/Notifications.test.tsx @@ -5,7 +5,7 @@ import { AppContext } from '../context/App'; import { Errors } from '../utils/errors'; import { NotificationsRoute } from './Notifications'; -jest.mock('../components/AccountNotifications', () => ({ +jest.mock('../components/notifications/AccountNotifications', () => ({ AccountNotifications: () =>

AccountNotifications

, })); diff --git a/src/renderer/routes/Notifications.tsx b/src/renderer/routes/Notifications.tsx index ab129c700..a2a35ede2 100644 --- a/src/renderer/routes/Notifications.tsx +++ b/src/renderer/routes/Notifications.tsx @@ -1,7 +1,8 @@ import { type FC, useContext, useMemo } from 'react'; -import { AccountNotifications } from '../components/AccountNotifications'; + import { AllRead } from '../components/AllRead'; import { Oops } from '../components/Oops'; +import { AccountNotifications } from '../components/notifications/AccountNotifications'; import { AppContext } from '../context/App'; import { getAccountUUID } from '../utils/auth/utils'; import { Errors } from '../utils/errors'; diff --git a/src/renderer/routes/Settings.test.tsx b/src/renderer/routes/Settings.test.tsx index b42da5da8..f46b83afe 100644 --- a/src/renderer/routes/Settings.test.tsx +++ b/src/renderer/routes/Settings.test.tsx @@ -49,7 +49,7 @@ describe('renderer/routes/Settings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Go Back')); + fireEvent.click(screen.getByTestId('header-nav-back')); expect(fetchNotifications).toHaveBeenCalledTimes(1); expect(mockNavigate).toHaveBeenNthCalledWith(1, -1); }); @@ -73,7 +73,8 @@ describe('renderer/routes/Settings.tsx', () => { ); }); - fireEvent.click(screen.getByText('Restore settings to their defaults')); + fireEvent.click(screen.getByTestId('settings-reset')); + expect(resetSettings).toHaveBeenCalled(); }); @@ -96,7 +97,8 @@ describe('renderer/routes/Settings.tsx', () => { ); }); - fireEvent.click(screen.getByText('Restore settings to their defaults')); + fireEvent.click(screen.getByTestId('settings-reset')); + expect(resetSettings).not.toHaveBeenCalled(); }); }); diff --git a/src/renderer/routes/Settings.tsx b/src/renderer/routes/Settings.tsx index 2ee168061..991e29e99 100644 --- a/src/renderer/routes/Settings.tsx +++ b/src/renderer/routes/Settings.tsx @@ -1,6 +1,9 @@ -import { GearIcon } from '@primer/octicons-react'; import { type FC, useContext } from 'react'; -import { Header } from '../components/Header'; + +import { GearIcon } from '@primer/octicons-react'; +import { Button, Stack } from '@primer/react'; + +import { Header } from '../components/primitives/Header'; import { AppearanceSettings } from '../components/settings/AppearanceSettings'; import { NotificationSettings } from '../components/settings/NotificationSettings'; import { SettingsFooter } from '../components/settings/SettingsFooter'; @@ -11,28 +14,34 @@ export const SettingsRoute: FC = () => { const { resetSettings } = useContext(AppContext); return ( -
-
- Settings -
+ <> +
+
+ Settings +
-
- - - - -
+
+ + + + + + + +
- -
+ +
+ ); }; diff --git a/src/renderer/routes/__snapshots__/Accounts.test.tsx.snap b/src/renderer/routes/__snapshots__/Accounts.test.tsx.snap index 2ba0493f3..425294739 100644 --- a/src/renderer/routes/__snapshots__/Accounts.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/Accounts.test.tsx.snap @@ -6,696 +6,1092 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre data-testid="accounts" >
- -

- + + +
+ - Accounts - -

+

+ Accounts +

+
+
-
+ -
-
- + - github.com - -
-
- + + - Personal Access Token - +
-
- - - - -
-
+ -
-
- + - github.gitify.io - -
-
- + + - OAuth App - +
-
- - - - -
-
+ -
-
- + - github.com - -
-
- + + - GitHub App - +
-
- - - - -
- -
- - - -
+ Add new account + + +
`; diff --git a/src/renderer/routes/__snapshots__/Filters.test.tsx.snap b/src/renderer/routes/__snapshots__/Filters.test.tsx.snap index aeb0a794e..d33214859 100644 --- a/src/renderer/routes/__snapshots__/Filters.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/Filters.test.tsx.snap @@ -6,53 +6,82 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children data-testid="filters" >
- -

- + + +
+ - Filters - -

+

+ Filters +

+
+
- Note: if no reasons are selected, all notifications will be shown. + Note: If no reasons are selected, all notifications will be shown.
-
+ -
+
`; diff --git a/src/renderer/routes/__snapshots__/Login.test.tsx.snap b/src/renderer/routes/__snapshots__/Login.test.tsx.snap index 11b9c9a05..2bd3334e5 100644 --- a/src/renderer/routes/__snapshots__/Login.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/Login.test.tsx.snap @@ -6,7 +6,232 @@ exports[`renderer/routes/Login.tsx should render itself & its children 1`] = ` "baseElement":
+
+ + + + + + + + + + + +
+

+ GitHub Notifications +

+

+ on your menu bar +

+
+
+ + Login with + + + + +
+
+
+
+ , + "container":
+
+
- GitHub Notifications -
- on your menu bar. +

+ GitHub Notifications +

+

+ on your menu bar +

- Login with -
- - - -
-
- , - "container":
-
- - - + + + + + GitHub + + + + + +
- - -
, "debug": [Function], diff --git a/src/renderer/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap b/src/renderer/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap index 5c0558c87..669206372 100644 --- a/src/renderer/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap @@ -7,53 +7,82 @@ exports[`renderer/routes/LoginWithOAuthApp.tsx renders correctly 1`] = `
- -

- + + +
+ - Login with OAuth App - -

+

+ Login with OAuth App +

+
+
- - - on GitHub then paste your - + + + + + + Create new OAuth App + + + + + on GitHub then paste your + +
- client id and client secret + + client id and client secret + + below. - below.
@@ -155,54 +224,109 @@ exports[`renderer/routes/LoginWithOAuthApp.tsx renders correctly 1`] = ` />
- - + + - - Login - + + + + + + Login + + + +
@@ -212,53 +336,82 @@ exports[`renderer/routes/LoginWithOAuthApp.tsx renders correctly 1`] = ` "container":
- -

- + + +
+ - Login with OAuth App - -

+

+ Login with OAuth App +

+
+
- - - on GitHub then paste your - + + + + + + Create new OAuth App + + + + + on GitHub then paste your + +
- client id and client secret + + client id and client secret + + below. - below.
@@ -360,54 +553,109 @@ exports[`renderer/routes/LoginWithOAuthApp.tsx renders correctly 1`] = ` />
- - + + - - Login - + + + + + + Login + + + +
diff --git a/src/renderer/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap b/src/renderer/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap index 9e68e4597..f2f77fb38 100644 --- a/src/renderer/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap @@ -6,53 +6,82 @@ exports[`renderer/routes/LoginWithPersonalAccessToken.tsx renders correctly 1`] "baseElement":
- -

- + + +
+ - Login with Personal Access Token - -

+

+ Login with Personal Access Token +

+
+
-
-
+ Change only if you are using GitHub Enterprise Server. -
+
- on GitHub then paste your - - - token - - below. + on GitHub then paste your token below.
-
The required scopes will be automatically selected for you. -
+
@@ -148,52 +204,109 @@ exports[`renderer/routes/LoginWithPersonalAccessToken.tsx renders correctly 1`] />
- - + + - - Login - + + + + + + Login + + + +
@@ -201,53 +314,82 @@ exports[`renderer/routes/LoginWithPersonalAccessToken.tsx renders correctly 1`] , "container":
- -

- + + +
+ - Login with Personal Access Token - -

+

+ Login with Personal Access Token +

+
+
-
-
+ Change only if you are using GitHub Enterprise Server. -
+
- on GitHub then paste your - - - token - - below. + on GitHub then paste your token below.
-
The required scopes will be automatically selected for you. -
+
@@ -343,52 +512,109 @@ exports[`renderer/routes/LoginWithPersonalAccessToken.tsx renders correctly 1`] />
- - + + - - Login - + + + + + + Login + + + +
diff --git a/src/renderer/routes/__snapshots__/Settings.test.tsx.snap b/src/renderer/routes/__snapshots__/Settings.test.tsx.snap index 2f0930cd7..426e97fbb 100644 --- a/src/renderer/routes/__snapshots__/Settings.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/Settings.test.tsx.snap @@ -6,39 +6,30 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = data-testid="settings" >
- -

- - Settings - -

-
-
-
- + +
- Appearance - -
-
-
+
+
+
+
+
+
+ +
+ + + Appearance + +
-
- - -
-
- -
+
- Dark - + + +
+
+ + +
-
-
- - - - 100 - % - - - -
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - Notifications - -
-
+
+
+
+ + + Notifications + +
-
- - + + +
+
+ + +
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- - - System - -
+ + System +
- -
-
-
- - + + +
+
+ + +
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- + + +
- -
- + +
+
+ - - - - - + + - - - - + + +
diff --git a/src/renderer/styles/gitify.ts b/src/renderer/styles/gitify.ts deleted file mode 100644 index d6a2e6d47..000000000 --- a/src/renderer/styles/gitify.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const BUTTON_CLASS_NAME = - 'hover:text-gray-500 py-1 px-2 my-1 mx-2 focus:outline-none'; diff --git a/src/renderer/utils/__snapshots__/icons.test.ts.snap b/src/renderer/utils/__snapshots__/icons.test.ts.snap index 401c10eb5..c155ee85f 100644 --- a/src/renderer/utils/__snapshots__/icons.test.ts.snap +++ b/src/renderer/utils/__snapshots__/icons.test.ts.snap @@ -1,5 +1,40 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[` 1`] = ` +{ + "$$typeof": Symbol(react.forward_ref), + "render": [Function], +} +`; + +exports[` 2`] = ` +{ + "$$typeof": Symbol(react.forward_ref), + "render": [Function], +} +`; + +exports[` 3`] = ` +{ + "$$typeof": Symbol(react.forward_ref), + "render": [Function], +} +`; + +exports[` 4`] = ` +{ + "$$typeof": Symbol(react.forward_ref), + "render": [Function], +} +`; + +exports[` 5`] = ` +{ + "$$typeof": Symbol(react.forward_ref), + "render": [Function], +} +`; + exports[`renderer/utils/icons.ts getNotificationTypeIconColor should format the notification color for check suite 1`] = `"text-gray-500 dark:text-gray-300"`; exports[`renderer/utils/icons.ts getNotificationTypeIconColor should format the notification color for check suite 2`] = `"text-red-500"`; diff --git a/src/renderer/utils/filters.test.ts b/src/renderer/utils/filters.test.ts new file mode 100644 index 000000000..3293e62d7 --- /dev/null +++ b/src/renderer/utils/filters.test.ts @@ -0,0 +1,28 @@ +import { defaultSettings } from '../context/App'; +import type { SettingsState } from '../types'; +import { getFilterCount, hasFiltersSet } from './filters'; + +describe('renderer/utils/filters.ts', () => { + it('default filter settings', () => { + expect(getFilterCount(defaultSettings)).toBe(0); + expect(hasFiltersSet(defaultSettings)).toBe(false); + }); + + it('non-default reason filters', () => { + const settings = { + ...defaultSettings, + filterReasons: ['subscribed', 'manual'], + } as SettingsState; + expect(getFilterCount(settings)).toBe(2); + expect(hasFiltersSet(settings)).toBe(true); + }); + + it('non-default bot filters', () => { + const settings = { + ...defaultSettings, + hideBots: true, + } as SettingsState; + expect(getFilterCount(settings)).toBe(1); + expect(hasFiltersSet(settings)).toBe(true); + }); +}); diff --git a/src/renderer/utils/filters.ts b/src/renderer/utils/filters.ts new file mode 100644 index 000000000..921b0e1b8 --- /dev/null +++ b/src/renderer/utils/filters.ts @@ -0,0 +1,23 @@ +import { defaultSettings } from '../context/App'; +import type { SettingsState } from '../types'; + +export function getFilterCount(settings: SettingsState): number { + let count = 0; + + if (settings.filterReasons.length !== defaultSettings.filterReasons.length) { + count += settings.filterReasons.length; + } + + if ( + settings.detailedNotifications && + settings.hideBots !== defaultSettings.hideBots + ) { + count += 1; + } + + return count; +} + +export function hasFiltersSet(settings: SettingsState): boolean { + return getFilterCount(settings) > 0; +} diff --git a/src/renderer/utils/helpers.test.ts b/src/renderer/utils/helpers.test.ts index 3656aaf6b..2c9f69c34 100644 --- a/src/renderer/utils/helpers.test.ts +++ b/src/renderer/utils/helpers.test.ts @@ -11,8 +11,7 @@ import { ChevronRightIcon, } from '@primer/octicons-react'; import log from 'electron-log'; -import { defaultSettings } from '../context/App'; -import type { Hostname, Link, SettingsState } from '../types'; +import type { Hostname, Link } from '../types'; import type { SubjectType } from '../typesGitHub'; import { mockGraphQLResponse, @@ -25,7 +24,6 @@ import { generateGitHubWebUrl, generateNotificationReferrerId, getChevronDetails, - getFilterCount, getPlatformFromHostname, isEnterpriseServerHost, isMarkAsDoneFeatureSupported, @@ -614,28 +612,6 @@ describe('renderer/utils/helpers.ts', () => { }); }); - describe('filter count', () => { - it('default filter settings', () => { - expect(getFilterCount(defaultSettings)).toBe(0); - }); - - it('non-default reason filters', () => { - const settings = { - ...defaultSettings, - filterReasons: ['subscribed', 'manual'], - } as SettingsState; - expect(getFilterCount(settings)).toBe(2); - }); - - it('non-default bot filters', () => { - const settings = { - ...defaultSettings, - hideBots: true, - } as SettingsState; - expect(getFilterCount(settings)).toBe(1); - }); - }); - describe('getChevronDetails', () => { it('should return correct chevron details', () => { expect(getChevronDetails(true, true, 'account')).toEqual({ diff --git a/src/renderer/utils/helpers.ts b/src/renderer/utils/helpers.ts index e3b2a7bc1..a1d54748f 100644 --- a/src/renderer/utils/helpers.ts +++ b/src/renderer/utils/helpers.ts @@ -5,8 +5,7 @@ import { } from '@primer/octicons-react'; import { formatDistanceToNowStrict, parseISO } from 'date-fns'; import log from 'electron-log'; -import { defaultSettings } from '../context/App'; -import type { Account, Chevron, Hostname, Link, SettingsState } from '../types'; +import type { Account, Chevron, Hostname, Link } from '../types'; import type { Notification } from '../typesGitHub'; import { getHtmlUrl, getLatestDiscussion } from './api/client'; import type { PlatformType } from './auth/types'; @@ -206,23 +205,6 @@ export function formatNotificationUpdatedAt( return ''; } -export function getFilterCount(settings: SettingsState): number { - let count = 0; - - if (settings.filterReasons.length !== defaultSettings.filterReasons.length) { - count += settings.filterReasons.length; - } - - if ( - settings.detailedNotifications && - settings.hideBots !== defaultSettings.hideBots - ) { - count += 1; - } - - return count; -} - export function getChevronDetails( hasNotifications: boolean, isVisible: boolean, diff --git a/src/renderer/utils/icons.test.ts b/src/renderer/utils/icons.test.ts index 825aeac99..4c935f6a1 100644 --- a/src/renderer/utils/icons.test.ts +++ b/src/renderer/utils/icons.test.ts @@ -7,8 +7,10 @@ import type { SubjectType, } from '../typesGitHub'; import { + getAuthMethodIcon, getNotificationTypeIcon, getNotificationTypeIconColor, + getPlatformIcon, getPullRequestReviewIcon, } from './icons'; @@ -19,6 +21,7 @@ describe('renderer/utils/icons.ts', () => { createSubjectMock({ type: 'CheckSuite', state: null }), ).displayName, ).toBe('RocketIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -27,6 +30,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('StopIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -35,6 +39,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('XIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -43,6 +48,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('SkipIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -51,37 +57,45 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('CheckIcon'); + expect( getNotificationTypeIcon(createSubjectMock({ type: 'Commit' })) .displayName, ).toBe('GitCommitIcon'); + expect( getNotificationTypeIcon(createSubjectMock({ type: 'Discussion' })) .displayName, ).toBe('CommentDiscussionIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ type: 'Discussion', state: 'DUPLICATE' }), ).displayName, ).toBe('DiscussionDuplicateIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ type: 'Discussion', state: 'OUTDATED' }), ).displayName, ).toBe('DiscussionOutdatedIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ type: 'Discussion', state: 'RESOLVED' }), ).displayName, ).toBe('DiscussionClosedIcon'); + expect( getNotificationTypeIcon(createSubjectMock({ type: 'Issue' })).displayName, ).toBe('IssueOpenedIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ type: 'Issue', state: 'draft' }), ).displayName, ).toBe('IssueDraftIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -90,6 +104,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('IssueClosedIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -98,6 +113,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('IssueClosedIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -106,6 +122,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('SkipIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -114,10 +131,12 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('IssueReopenedIcon'); + expect( getNotificationTypeIcon(createSubjectMock({ type: 'PullRequest' })) .displayName, ).toBe('GitPullRequestIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -126,6 +145,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('GitPullRequestDraftIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -134,6 +154,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('GitPullRequestClosedIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -142,6 +163,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('GitMergeIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -149,6 +171,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('TagIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -156,6 +179,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('AlertIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -163,6 +187,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('MailIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -170,6 +195,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('AlertIcon'); + expect( getNotificationTypeIcon( createSubjectMock({ @@ -177,6 +203,7 @@ describe('renderer/utils/icons.ts', () => { }), ).displayName, ).toBe('RocketIcon'); + expect(getNotificationTypeIcon(createSubjectMock({})).displayName).toBe( 'QuestionIcon', ); @@ -192,6 +219,7 @@ describe('renderer/utils/icons.ts', () => { }), ), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor( createSubjectMock({ @@ -209,6 +237,7 @@ describe('renderer/utils/icons.ts', () => { }), ), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor( createSubjectMock({ @@ -217,6 +246,7 @@ describe('renderer/utils/icons.ts', () => { }), ), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor( createSubjectMock({ @@ -231,32 +261,41 @@ describe('renderer/utils/icons.ts', () => { expect( getNotificationTypeIconColor(createSubjectMock({ state: 'ANSWERED' })), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor(createSubjectMock({ state: 'closed' })), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor(createSubjectMock({ state: 'completed' })), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor(createSubjectMock({ state: 'draft' })), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor(createSubjectMock({ state: 'merged' })), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor( createSubjectMock({ state: 'not_planned' }), ), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor(createSubjectMock({ state: 'open' })), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor(createSubjectMock({ state: 'reopened' })), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor(createSubjectMock({ state: 'RESOLVED' })), ).toMatchSnapshot(); + expect( getNotificationTypeIconColor( createSubjectMock({ @@ -359,6 +398,20 @@ describe('renderer/utils/icons.ts', () => { expect(getPullRequestReviewIcon(mockReviewMultipleReviewer)).toBeNull(); }); }); + + describe('getAuthMethodIcon', () => { + expect(getAuthMethodIcon('GitHub App')).toMatchSnapshot(); + + expect(getAuthMethodIcon('OAuth App')).toMatchSnapshot(); + + expect(getAuthMethodIcon('Personal Access Token')).toMatchSnapshot(); + }); + + describe('getPlatformIcon', () => { + expect(getPlatformIcon('GitHub Cloud')).toMatchSnapshot(); + + expect(getPlatformIcon('GitHub Enterprise Server')).toMatchSnapshot(); + }); }); function createSubjectMock(mocks: { diff --git a/src/renderer/utils/icons.ts b/src/renderer/utils/icons.ts index f6ae990bd..8641f913e 100644 --- a/src/renderer/utils/icons.ts +++ b/src/renderer/utils/icons.ts @@ -1,5 +1,6 @@ import { AlertIcon, + AppsIcon, CheckIcon, CommentDiscussionIcon, CommentIcon, @@ -16,10 +17,14 @@ import { IssueDraftIcon, IssueOpenedIcon, IssueReopenedIcon, + KeyIcon, MailIcon, + MarkGithubIcon, type OcticonProps, + PersonIcon, QuestionIcon, RocketIcon, + ServerIcon, SkipIcon, StopIcon, TagIcon, @@ -28,6 +33,7 @@ import { import type { FC } from 'react'; import { IconColor, type PullRequestApprovalIcon } from '../types'; import type { GitifyPullRequestReview, Subject } from '../typesGitHub'; +import type { AuthMethod, PlatformType } from './auth/types'; export function getNotificationTypeIcon(subject: Subject): FC { switch (subject.type) { @@ -152,3 +158,25 @@ export function getPullRequestReviewIcon( return null; } } + +export function getAuthMethodIcon(method: AuthMethod): FC | null { + switch (method) { + case 'GitHub App': + return AppsIcon; + case 'OAuth App': + return PersonIcon; + default: + return KeyIcon; + } +} + +export function getPlatformIcon( + platform: PlatformType, +): FC | null { + switch (platform) { + case 'GitHub Enterprise Server': + return ServerIcon; + default: + return MarkGithubIcon; + } +} diff --git a/src/renderer/utils/theme.ts b/src/renderer/utils/theme.ts index 25a261f0d..a92cca9ed 100644 --- a/src/renderer/utils/theme.ts +++ b/src/renderer/utils/theme.ts @@ -1,5 +1,6 @@ import { Theme } from '../types'; +// TODO - Replace fully with Octicon primer theme provider export function getTheme(): Theme { if (document.querySelector('html').classList.contains('dark')) { return Theme.DARK;