diff --git a/app/soapbox/components/__mocks__/react-inlinesvg.js b/app/soapbox/components/__mocks__/react-inlinesvg.js index 41000c5cc..b63d1a967 100644 --- a/app/soapbox/components/__mocks__/react-inlinesvg.js +++ b/app/soapbox/components/__mocks__/react-inlinesvg.js @@ -6,5 +6,5 @@ export default function InlineSVG({ src }) { } InlineSVG.propTypes = { - src: PropTypes.node.isRequired, + src: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired, }; diff --git a/app/soapbox/components/icon.js b/app/soapbox/components/icon.js index 7c7625806..3a7059061 100644 --- a/app/soapbox/components/icon.js +++ b/app/soapbox/components/icon.js @@ -15,7 +15,7 @@ export default class Icon extends React.PureComponent { static propTypes = { id: PropTypes.string, - src: PropTypes.string, + src: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), className: PropTypes.string, fixedWidth: PropTypes.bool, }; diff --git a/app/soapbox/components/svg_icon.js b/app/soapbox/components/svg_icon.js index 2e02a1585..6152f56f2 100644 --- a/app/soapbox/components/svg_icon.js +++ b/app/soapbox/components/svg_icon.js @@ -12,7 +12,7 @@ import InlineSVG from 'react-inlinesvg'; export default class SvgIcon extends React.PureComponent { static propTypes = { - src: PropTypes.string.isRequired, + src: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired, alt: PropTypes.string, className: PropTypes.string, }; diff --git a/app/soapbox/components/ui/icon/icon.tsx b/app/soapbox/components/ui/icon/icon.tsx index 340a22a91..fcf1a79de 100644 --- a/app/soapbox/components/ui/icon/icon.tsx +++ b/app/soapbox/components/ui/icon/icon.tsx @@ -8,18 +8,16 @@ interface IIcon { src: string, } -const Icon = ({ src, alt, count, ...filteredProps }: IIcon): JSX.Element => { - return ( -
- {count ? ( - - {count} - - ) : null} +const Icon = ({ src, alt, count, ...filteredProps }: IIcon): JSX.Element => ( +
+ {count ? ( + + {count} + + ) : null} - -
- ); -}; + +
+); export default Icon; diff --git a/app/soapbox/features/verification/steps/__tests__/age-verification.test.js b/app/soapbox/features/verification/steps/__tests__/age-verification.test.js index c5b6bed7a..122df77bd 100644 --- a/app/soapbox/features/verification/steps/__tests__/age-verification.test.js +++ b/app/soapbox/features/verification/steps/__tests__/age-verification.test.js @@ -1,7 +1,6 @@ import userEvent from '@testing-library/user-event'; import { Map as ImmutableMap } from 'immutable'; import React from 'react'; -import '@testing-library/jest-dom'; import { __stub } from 'soapbox/api'; import { fireEvent, render, screen } from 'soapbox/jest/test-helpers'; diff --git a/app/soapbox/features/verification/steps/__tests__/email-verification.test.js b/app/soapbox/features/verification/steps/__tests__/email-verification.test.js index 604b8b536..9e05686b7 100644 --- a/app/soapbox/features/verification/steps/__tests__/email-verification.test.js +++ b/app/soapbox/features/verification/steps/__tests__/email-verification.test.js @@ -1,6 +1,5 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; -import '@testing-library/jest-dom'; import { __stub } from 'soapbox/api'; import { fireEvent, render, screen, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/app/soapbox/features/verification/steps/__tests__/sms-verification.test.js b/app/soapbox/features/verification/steps/__tests__/sms-verification.test.js index f6a997e2b..65ba19528 100644 --- a/app/soapbox/features/verification/steps/__tests__/sms-verification.test.js +++ b/app/soapbox/features/verification/steps/__tests__/sms-verification.test.js @@ -1,6 +1,5 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; -import '@testing-library/jest-dom'; import { __stub } from 'soapbox/api'; import { fireEvent, render, screen, waitFor } from 'soapbox/jest/test-helpers'; diff --git a/jest.config.js b/jest.config.js index 0c8d79433..3e7e62a67 100644 --- a/jest.config.js +++ b/jest.config.js @@ -22,7 +22,7 @@ module.exports = { '!app/soapbox/locales/locale-data/*.js', '!app/soapbox/service_worker/entry.js', '!app/soapbox/jest/test-setup.ts', - '!app/soapbox/jest/test-helpers.tsx', + '!app/soapbox/jest/test-helpers.ts', ], 'coverageDirectory': '/coverage', 'moduleDirectories': [