From 1e2db6950286f1103e26cf9f58d541bc8dee26c7 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Sun, 22 Nov 2020 12:33:46 +0000 Subject: [PATCH 1/5] chore: Update more dependencies --- package.json | 8 ++++---- yarn.lock | 53 ++++++++++++++++++++++------------------------------ 2 files changed, 26 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 7eb3fd5e8..91eb7303a 100644 --- a/package.json +++ b/package.json @@ -107,8 +107,8 @@ }, "dependencies": { "@primer/octicons-react": "^9.6.0", - "axios": "=0.19.2", - "date-fns": "^2.11.1", + "axios": "=0.21.0", + "date-fns": "^2.16.1", "electron-updater": "^4.3.5", "final-form": "^4.19.1", "lodash": "^4.17.20", @@ -135,8 +135,8 @@ "devDependencies": { "@testing-library/react": "^10.0.2", "@types/jest": "^26.0.15", - "@types/lodash": "^4.14.149", - "@types/node": "^13.11.0", + "@types/lodash": "^4.14.165", + "@types/node": "^14.14.9", "@types/react": "^16.9.32", "@types/react-redux": "^7.1.7", "@types/react-transition-group": "^4.2.4", diff --git a/yarn.lock b/yarn.lock index 0b6d7d3b6..0d49c11b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -754,10 +754,10 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw== -"@types/lodash@^4.14.149": - version "4.14.156" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.156.tgz#cbe30909c89a1feeb7c60803e785344ea0ec82d1" - integrity sha512-l2AgHXcKUwx2DsvP19wtRPqZ4NkONjmorOdq4sMcxIjqdIuuV/ULo2ftuv4NUpevwfW7Ju/UKLqo0ZXuEt/8lQ== +"@types/lodash@^4.14.165": + version "4.14.165" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.165.tgz#74d55d947452e2de0742bad65270433b63a8c30f" + integrity sha512-tjSSOTHhI5mCHTy/OOXYIhi2Wt1qcbHmuXD1Ha7q70CgI/I71afO4XtLb/cVexki1oVYchpul/TOuu3Arcdxrg== "@types/node@*": version "14.0.13" @@ -769,10 +769,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.47.tgz#5007b8866a2f9150de82335ca7e24dd1d59bdfb5" integrity sha512-yzBInQFhdY8kaZmqoL2+3U5dSTMrKaYcb561VU+lDzAYvqt+2lojvBEy+hmpSNuXnPTx7m9+04CzWYOUqWME2A== -"@types/node@^13.11.0": - version "13.13.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.12.tgz#9c72e865380a7dc99999ea0ef20fc9635b503d20" - integrity sha512-zWz/8NEPxoXNT9YyF2osqyA9WjssZukYpgI4UYZpOjcyqwIUqWGkcCionaEb9Ki+FULyPyvNFpg/329Kd2/pbw== +"@types/node@^14.14.9": + version "14.14.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.9.tgz#04afc9a25c6ff93da14deabd65dc44485b53c8d6" + integrity sha512-JsoLXFppG62tWTklIoO4knA+oDTYsmqWxHRvd4lpmfQRNhX6osheUOWETP2jMoV/2bEHuMra8Pp3Dmo/stBFcw== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -1263,12 +1263,12 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.0.tgz#a17b3a8ea811060e74d47d306122400ad4497ae2" integrity sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA== -axios@=0.19.2: - version "0.19.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27" - integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA== +axios@=0.21.0: + version "0.21.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.0.tgz#26df088803a2350dff2c27f96fef99fe49442aca" + integrity sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw== dependencies: - follow-redirects "1.5.10" + follow-redirects "^1.10.0" babel-jest@^26.6.3: version "26.6.3" @@ -1890,17 +1890,10 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" -date-fns@^2.11.1: - version "2.14.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.14.0.tgz#359a87a265bb34ef2e38f93ecf63ac453f9bc7ba" - integrity sha512-1zD+68jhFgDIM0rF05rcwYO8cExdNqxjq4xP1QKM60Q45mnO6zaMWB4tOzrIr4M4GSLntsKeE4c9Bdl2jhL/yw== - -debug@=3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" +date-fns@^2.16.1: + version "2.16.1" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.16.1.tgz#05775792c3f3331da812af253e1a935851d3834b" + integrity sha512-sAJVKx/FqrLYHAQeN7VpJrPhagZc9R4ImZIWYRFZaaohR3KzmuK88touwsSwSVT8Qcbd4zoDsnGfX4GFB4imyQ== debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: version "2.6.9" @@ -2505,12 +2498,10 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -follow-redirects@1.5.10: - version "1.5.10" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" - integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== - dependencies: - debug "=3.1.0" +follow-redirects@^1.10.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" + integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== for-in@^1.0.2: version "1.0.2" @@ -4379,7 +4370,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.4" -prop-types@^15.5.10, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== From 70cc8b63109ce4b7f024130ad9ac0ba3a8ed7e01 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Sun, 22 Nov 2020 12:34:32 +0000 Subject: [PATCH 2/5] feat: Update Octicons --- package.json | 2 +- src/js/components/account-notifications.tsx | 9 ++++----- src/js/components/notification.tsx | 14 +++++--------- src/js/components/repository.tsx | 8 ++------ src/js/components/sidebar.tsx | 10 +++++----- src/js/routes/enterprise-login.tsx | 4 ++-- src/js/utils/github-api.ts | 21 ++++++++++++--------- yarn.lock | 10 ++++------ 8 files changed, 35 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 91eb7303a..2a69a4cb6 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "afterSign": "scripts/notarize.js" }, "dependencies": { - "@primer/octicons-react": "^9.6.0", + "@primer/octicons-react": "^11.1.0", "axios": "=0.21.0", "date-fns": "^2.16.1", "electron-updater": "^4.3.5", diff --git a/src/js/components/account-notifications.tsx b/src/js/components/account-notifications.tsx index 1e7b7674d..60dec29d9 100644 --- a/src/js/components/account-notifications.tsx +++ b/src/js/components/account-notifications.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import * as _ from 'lodash'; import styled from 'styled-components'; -import Octicon, { ChevronDown, ChevronLeft } from '@primer/octicons-react'; +import { ChevronDownIcon, ChevronLeftIcon } from '@primer/octicons-react'; import { Notification } from '../../types/github'; import RepositoryNotifications from './repository'; @@ -34,16 +34,15 @@ export const AccountNotifications = (props: IProps) => { .sortBy((_, key) => key) .value(); + const Chevron = notifications.length > 0 ? ChevronDownIcon : ChevronLeftIcon; + return ( <> {showAccountHostname && ( {hostname} - 0 ? ChevronDown : ChevronLeft} - size={20} - /> + )} diff --git a/src/js/components/notification.tsx b/src/js/components/notification.tsx index 3b930550c..f6bd3202e 100644 --- a/src/js/components/notification.tsx +++ b/src/js/components/notification.tsx @@ -3,7 +3,7 @@ const { shell } = require('electron'); import * as React from 'react'; import { connect } from 'react-redux'; import { formatDistanceToNow, parseISO } from 'date-fns'; -import Octicon, { Check, Mute, getIconByName } from '@primer/octicons-react'; +import { CheckIcon, MuteIcon } from '@primer/octicons-react'; import styled from 'styled-components'; import { AppState } from '../../types/reducers'; @@ -113,7 +113,7 @@ export const NotificationItem: React.FC = (props) => { const { notification } = props; const reason = formatReason(notification.reason); - const typeIcon = getNotificationTypeIcon(notification.subject.type); + const NotificationIcon = getNotificationTypeIcon(notification.subject.type); const updatedAt = formatDistanceToNow(parseISO(notification.updated_at), { addSuffix: true, }); @@ -121,11 +121,7 @@ export const NotificationItem: React.FC = (props) => { return ( - +
pressTitle()} role="main"> {notification.subject.title} @@ -134,13 +130,13 @@ export const NotificationItem: React.FC = (props) => { {reason.type} - Updated{' '} {updatedAt} unsubscribe(e)}> - +
markAsRead()}> - +
diff --git a/src/js/components/repository.tsx b/src/js/components/repository.tsx index 0d2480aaa..473e158df 100644 --- a/src/js/components/repository.tsx +++ b/src/js/components/repository.tsx @@ -3,7 +3,7 @@ const { shell } = require('electron'); import * as React from 'react'; import styled from 'styled-components'; import { connect } from 'react-redux'; -import Octicon, { Check } from '@primer/octicons-react'; +import { CheckIcon } from '@primer/octicons-react'; import { CSSTransition, TransitionGroup } from 'react-transition-group'; import { markRepoNotifications } from '../actions'; @@ -84,11 +84,7 @@ export const RepositoryNotifications: React.FC = (props) => { diff --git a/src/js/components/sidebar.tsx b/src/js/components/sidebar.tsx index 562babab0..8cf520519 100644 --- a/src/js/components/sidebar.tsx +++ b/src/js/components/sidebar.tsx @@ -3,7 +3,7 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import { shell } from 'electron'; -import Octicon, { Bell, Gear, Sync, MarkGithub } from '@primer/octicons-react'; +import * as Octicons from '@primer/octicons-react'; import styled from 'styled-components'; import { AppState } from '../../types/reducers'; @@ -155,7 +155,7 @@ export class Sidebar extends React.Component { {notificationsCount > 0 && ( - + {notificationsCount} )} @@ -168,14 +168,14 @@ export class Sidebar extends React.Component { onClick={this.refreshNotifications.bind(this)} aria-label="Refresh Notifications" > - + - + )} @@ -184,7 +184,7 @@ export class Sidebar extends React.Component { onClick={this.onOpenBrowser} aria-label="View project on GitHub" > - + diff --git a/src/js/routes/enterprise-login.tsx b/src/js/routes/enterprise-login.tsx index 7a07766da..099dc2f1f 100644 --- a/src/js/routes/enterprise-login.tsx +++ b/src/js/routes/enterprise-login.tsx @@ -3,7 +3,7 @@ const ipcRenderer = require('electron').ipcRenderer; import * as React from 'react'; import { Form, FormRenderProps } from 'react-final-form'; import { connect } from 'react-redux'; -import Octicon, { MarkGithub } from '@primer/octicons-react'; +import { MarkGithubIcon } from '@primer/octicons-react'; import styled from 'styled-components'; import { AppState } from '../../types/reducers'; @@ -132,7 +132,7 @@ export class EnterpriseLogin extends React.Component { type="submit" title="Login Button" > - + Login to GitHub Enterprise diff --git a/src/js/utils/github-api.ts b/src/js/utils/github-api.ts index fa60dd1bc..521ebf465 100644 --- a/src/js/utils/github-api.ts +++ b/src/js/utils/github-api.ts @@ -1,4 +1,5 @@ import { Reason, SubjectType } from '../../types/github'; +import * as Octicons from '@primer/octicons-react'; // prettier-ignore const DESCRIPTIONS = { @@ -51,23 +52,25 @@ export function formatReason( } } -export function getNotificationTypeIcon(type: SubjectType): string { +export function getNotificationTypeIcon( + type: SubjectType +): React.FC { switch (type) { case 'CheckSuite': - return 'sync'; + return Octicons.SyncIcon; case 'Commit': - return 'git-commit'; + return Octicons.GitCommitIcon; case 'Discussion': - return 'comment-discussion'; + return Octicons.CommentDiscussionIcon; case 'Issue': - return 'issue-opened'; + return Octicons.IssueOpenedIcon; case 'PullRequest': - return 'git-pull-request'; + return Octicons.GitPullRequestIcon; case 'Release': - return 'tag'; + return Octicons.TagIcon; case 'RepositoryVulnerabilityAlert': - return 'alert'; + return Octicons.AlertIcon; default: - return 'question'; + return Octicons.QuestionIcon; } } diff --git a/yarn.lock b/yarn.lock index 0d49c11b1..bfee2628e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -554,12 +554,10 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@primer/octicons-react@^9.6.0": - version "9.6.0" - resolved "https://registry.yarnpkg.com/@primer/octicons-react/-/octicons-react-9.6.0.tgz#996f621cb063757a4985cd6b45e59ed00e3444bf" - integrity sha512-FR0fiU1UY1ds5ZMCUY+iVkkm1Eh4yDHf2ui+cxB3VvYX23DAdUAohPGit+qaMFy2caDd7uWYGRZduKS7dW1FZQ== - dependencies: - prop-types "^15.6.1" +"@primer/octicons-react@^11.1.0": + version "11.1.0" + resolved "https://registry.yarnpkg.com/@primer/octicons-react/-/octicons-react-11.1.0.tgz#1f03bfdc598ea24006cf03a0adcab2812d0fc958" + integrity sha512-1d/0HM4eR6+meZh3OR1HaVCg6DLBwrBEwQBN6SblOlA/98HRGaphRHGwUV7YMbSfFUc1029Ggx54ceKYHYwdXA== "@scarf/scarf@^1.0.5": version "1.0.6" From 2f2104cb46047356523a0fb32d17edbebfd720dc Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Sun, 22 Nov 2020 12:36:57 +0000 Subject: [PATCH 3/5] chore: Update Prettier --- .github/workflows/run-tests.yml | 2 +- .prettierrc | 4 ---- .prettierrc.js | 4 ++++ README.md | 2 +- package.json | 6 +++--- yarn.lock | 8 ++++---- 6 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 .prettierrc create mode 100644 .prettierrc.js diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 2ff68c1cb..f5c55be26 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -24,7 +24,7 @@ jobs: run: yarn install - name: Run Prettier (Check) - run: yarn prettier-check + run: yarn prettier:check - name: Run Jest run: yarn test --coverage --runInBand diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 92de97148..000000000 --- a/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -trailingComma: "es5" -tabWidth: 2 -semi: true -singleQuote: true diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 000000000..91ca27a27 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,4 @@ +module.exports = { + tabWidth: 2, + singleQuote: true, +} diff --git a/README.md b/README.md index 62e2fca18..cd034af25 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ The release process is automated. Follow the steps below. There are 2 checks - one for prettier and one for the unit tests with `jest`. // Run prettier to check - yarn run prettier-check + yarn run prettier:check // Run linter & unit tests with coverage yarn run test diff --git a/package.json b/package.json index 2a69a4cb6..cc6a53344 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "make:linux": "electron-builder --linux", "make:macos": "electron-builder --mac", "make:win": "electron-builder --win", - "prettier-check": "prettier --check 'src/**/*.{js,ts,tsx}'", - "prettier": "prettier --single-quote --trailing-comma es5 --write 'src/**/*.{js,ts,tsx}'", + "prettier:check": "prettier --check 'src/**/*.{js,ts,tsx}'", + "prettier:apply": "prettier --write 'src/**/*.{js,ts,tsx}'", "jest": "jest", "test": "yarn jest", "start": "electron . -–enable-logging" @@ -146,7 +146,7 @@ "electron-notarize": "^1.0.0", "jest": "^26.6.3", "nock": "^12.0.3", - "prettier": "=2.0.2", + "prettier": "=2.2.0", "react-test-renderer": "=16.13.1", "redux-mock-store": "=1.5.4", "ts-jest": "^26.4.4", diff --git a/yarn.lock b/yarn.lock index bfee2628e..558d20541 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4325,10 +4325,10 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@=2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.2.tgz#1ba8f3eb92231e769b7fcd7cb73ae1b6b74ade08" - integrity sha512-5xJQIPT8BraI7ZnaDwSbu5zLrB6vvi8hVV58yHQ+QK64qrY40dULy0HSRlQ2/2IdzeBpjhDkqdcFBnFeDEMVdg== +prettier@=2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.0.tgz#8a03c7777883b29b37fb2c4348c66a78e980418b" + integrity sha512-yYerpkvseM4iKD/BXLYUkQV5aKt4tQPqaGW6EsZjzyu0r7sVZZNPJW4Y8MyKmicp6t42XUPcBVA+H6sB3gqndw== pretty-format@^25.5.0: version "25.5.0" From 7f0fb744e63364180a85917fede3f38e0c62091d Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Sun, 22 Nov 2020 13:15:32 +0000 Subject: [PATCH 4/5] chore: Fix tests --- .../account-notifications.test.tsx.snap | 36 +++---- .../__snapshots__/notification.test.tsx.snap | 50 ++++----- .../__snapshots__/repository.test.tsx.snap | 18 ++-- .../__snapshots__/sidebar.test.tsx.snap | 100 +++++++++--------- .../enterprise-login.test.tsx.snap | 14 +-- src/js/utils/github-api.test.ts | 18 ++-- 6 files changed, 118 insertions(+), 118 deletions(-) diff --git a/src/js/components/__snapshots__/account-notifications.test.tsx.snap b/src/js/components/__snapshots__/account-notifications.test.tsx.snap index 0f8df0eef..0384c411a 100644 --- a/src/js/components/__snapshots__/account-notifications.test.tsx.snap +++ b/src/js/components/__snapshots__/account-notifications.test.tsx.snap @@ -8,24 +8,24 @@ exports[`components/account-notifications.tsx should render itself (github.com w + viewBox="0 0 16 16" + width={20} + /> `; @@ -37,23 +37,23 @@ exports[`components/account-notifications.tsx should render itself (github.com w + viewBox="0 0 16 16" + width={20} + /> `; diff --git a/src/js/components/__snapshots__/notification.test.tsx.snap b/src/js/components/__snapshots__/notification.test.tsx.snap index dfecc2448..1f3b1c1c2 100644 --- a/src/js/components/__snapshots__/notification.test.tsx.snap +++ b/src/js/components/__snapshots__/notification.test.tsx.snap @@ -11,24 +11,24 @@ exports[`components/notification.js should render itself & its children 1`] = ` aria-hidden="false" aria-label="Issue" className="octicon" + dangerouslySetInnerHTML={ + Object { + "__html": "", + } + } + fill="currentColor" height={20} role="img" style={ Object { "display": "inline-block", - "fill": "currentColor", "userSelect": "none", "verticalAlign": "text-bottom", } } - viewBox="0 0 14 16" - width={17.5} - > - - + viewBox="0 0 16 16" + width={20} + />
", + } + } + fill="currentColor" height={13} role="img" style={ Object { "display": "inline-block", - "fill": "currentColor", "userSelect": "none", "verticalAlign": "text-bottom", } } viewBox="0 0 16 16" width={13} - > - - + />
@@ -93,24 +93,24 @@ exports[`components/notification.js should render itself & its children 1`] = ` aria-hidden="false" aria-label="Mark as Read" className="octicon" + dangerouslySetInnerHTML={ + Object { + "__html": "", + } + } + fill="currentColor" height={20} role="img" style={ Object { "display": "inline-block", - "fill": "currentColor", "userSelect": "none", "verticalAlign": "text-bottom", } } - viewBox="0 0 12 16" - width={15} - > - - + viewBox="0 0 16 16" + width={20} + /> diff --git a/src/js/components/__snapshots__/repository.test.tsx.snap b/src/js/components/__snapshots__/repository.test.tsx.snap index 466205151..52be3ef3f 100644 --- a/src/js/components/__snapshots__/repository.test.tsx.snap +++ b/src/js/components/__snapshots__/repository.test.tsx.snap @@ -29,24 +29,24 @@ Array [ aria-hidden="false" aria-label="Mark Repository as Read" className="octicon" + dangerouslySetInnerHTML={ + Object { + "__html": "", + } + } + fill="currentColor" height={20} role="img" style={ Object { "display": "inline-block", - "fill": "currentColor", "userSelect": "none", "verticalAlign": "text-bottom", } } - viewBox="0 0 12 16" - width={15} - > - - + viewBox="0 0 16 16" + width={20} + /> , diff --git a/src/js/components/__snapshots__/sidebar.test.tsx.snap b/src/js/components/__snapshots__/sidebar.test.tsx.snap index e325e2995..4de0ea123 100644 --- a/src/js/components/__snapshots__/sidebar.test.tsx.snap +++ b/src/js/components/__snapshots__/sidebar.test.tsx.snap @@ -57,24 +57,24 @@ exports[`components/Sidebar.tsx should render itself & its children (logged in) ", + } + } + fill="currentColor" height={12} role="img" style={ Object { "display": "inline-block", - "fill": "currentColor", "userSelect": "none", "verticalAlign": "text-bottom", } } - viewBox="0 0 15 16" - width={11.25} - > - - + viewBox="0 0 16 16" + width={12} + /> 4 @@ -89,24 +89,24 @@ exports[`components/Sidebar.tsx should render itself & its children (logged in) ", + } + } + fill="currentColor" height={16} role="img" style={ Object { "display": "inline-block", - "fill": "currentColor", "userSelect": "none", "verticalAlign": "text-bottom", } } - viewBox="0 0 12 16" - width={12} - > - - + viewBox="0 0 16 16" + width={16} + /> @@ -223,24 +223,24 @@ exports[`components/Sidebar.tsx should render itself & its children (logged out) ", + } + } + fill="currentColor" height={12} role="img" style={ Object { "display": "inline-block", - "fill": "currentColor", "userSelect": "none", "verticalAlign": "text-bottom", } } - viewBox="0 0 15 16" - width={11.25} - > - - + viewBox="0 0 16 16" + width={12} + /> 4 @@ -255,24 +255,24 @@ exports[`components/Sidebar.tsx should render itself & its children (logged out) ", + } + } + fill="currentColor" height={14} role="img" style={ Object { "display": "inline-block", - "fill": "currentColor", "userSelect": "none", "verticalAlign": "text-bottom", } } viewBox="0 0 16 16" width={14} - > - - + /> diff --git a/src/js/routes/__snapshots__/enterprise-login.test.tsx.snap b/src/js/routes/__snapshots__/enterprise-login.test.tsx.snap index 30a9bfadb..23f7e8373 100644 --- a/src/js/routes/__snapshots__/enterprise-login.test.tsx.snap +++ b/src/js/routes/__snapshots__/enterprise-login.test.tsx.snap @@ -96,24 +96,24 @@ exports[`routes/enterprise-login.js renders correctly 1`] = ` ", + } + } + fill="currentColor" height={16} role="img" style={ Object { "display": "inline-block", - "fill": "currentColor", "userSelect": "none", "verticalAlign": "text-bottom", } } viewBox="0 0 16 16" width={16} - > - - + /> Login to GitHub Enterprise diff --git a/src/js/utils/github-api.test.ts b/src/js/utils/github-api.test.ts index 926e61eb9..77747ea87 100644 --- a/src/js/utils/github-api.test.ts +++ b/src/js/utils/github-api.test.ts @@ -19,15 +19,15 @@ describe('./utils/github-api.ts', () => { }); it('should get the notification type icon', () => { - expect(getNotificationTypeIcon('CheckSuite')).toBe('sync'); - expect(getNotificationTypeIcon('Commit')).toBe('git-commit'); - expect(getNotificationTypeIcon('Discussion')).toBe('comment-discussion'); - expect(getNotificationTypeIcon('Issue')).toBe('issue-opened'); - expect(getNotificationTypeIcon('PullRequest')).toBe('git-pull-request'); - expect(getNotificationTypeIcon('Release')).toBe('tag'); - expect(getNotificationTypeIcon('RepositoryVulnerabilityAlert')).toBe( - 'alert' + expect(getNotificationTypeIcon('CheckSuite').name).toBe('SyncIcon'); + expect(getNotificationTypeIcon('Commit').name).toBe('GitCommitIcon'); + expect(getNotificationTypeIcon('Discussion').name).toBe('CommentDiscussionIcon'); + expect(getNotificationTypeIcon('Issue').name).toBe('IssueOpenedIcon'); + expect(getNotificationTypeIcon('PullRequest').name).toBe('GitPullRequestIcon'); + expect(getNotificationTypeIcon('Release').name).toBe('TagIcon'); + expect(getNotificationTypeIcon('RepositoryVulnerabilityAlert').name).toBe( + 'AlertIcon' ); - expect(getNotificationTypeIcon('Unknown' as SubjectType)).toBe('question'); + expect(getNotificationTypeIcon('Unknown'as SubjectType).name).toBe('QuestionIcon'); }); }); From 0e7d3d15ce5684b61c048e9685b06bf2957f5ae4 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Sun, 22 Nov 2020 13:26:52 +0000 Subject: [PATCH 5/5] chore: Fix prettier --- src/js/utils/github-api.test.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/js/utils/github-api.test.ts b/src/js/utils/github-api.test.ts index 77747ea87..e0b180f00 100644 --- a/src/js/utils/github-api.test.ts +++ b/src/js/utils/github-api.test.ts @@ -21,13 +21,19 @@ describe('./utils/github-api.ts', () => { it('should get the notification type icon', () => { expect(getNotificationTypeIcon('CheckSuite').name).toBe('SyncIcon'); expect(getNotificationTypeIcon('Commit').name).toBe('GitCommitIcon'); - expect(getNotificationTypeIcon('Discussion').name).toBe('CommentDiscussionIcon'); + expect(getNotificationTypeIcon('Discussion').name).toBe( + 'CommentDiscussionIcon' + ); expect(getNotificationTypeIcon('Issue').name).toBe('IssueOpenedIcon'); - expect(getNotificationTypeIcon('PullRequest').name).toBe('GitPullRequestIcon'); + expect(getNotificationTypeIcon('PullRequest').name).toBe( + 'GitPullRequestIcon' + ); expect(getNotificationTypeIcon('Release').name).toBe('TagIcon'); expect(getNotificationTypeIcon('RepositoryVulnerabilityAlert').name).toBe( 'AlertIcon' ); - expect(getNotificationTypeIcon('Unknown'as SubjectType).name).toBe('QuestionIcon'); + expect(getNotificationTypeIcon('Unknown' as SubjectType).name).toBe( + 'QuestionIcon' + ); }); });