Silence prop warnings in test suite
This commit is contained in:
parent
dcc90bc99a
commit
827bca3fd6
8 changed files with 14 additions and 19 deletions
|
@ -6,5 +6,5 @@ export default function InlineSVG({ src }) {
|
|||
}
|
||||
|
||||
InlineSVG.propTypes = {
|
||||
src: PropTypes.node.isRequired,
|
||||
src: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -8,8 +8,7 @@ interface IIcon {
|
|||
src: string,
|
||||
}
|
||||
|
||||
const Icon = ({ src, alt, count, ...filteredProps }: IIcon): JSX.Element => {
|
||||
return (
|
||||
const Icon = ({ src, alt, count, ...filteredProps }: IIcon): JSX.Element => (
|
||||
<div className='relative'>
|
||||
{count ? (
|
||||
<span className='absolute -top-2 -right-3 block px-1.5 py-0.5 bg-accent-500 text-xs text-white rounded-full ring-2 ring-white'>
|
||||
|
@ -19,7 +18,6 @@ const Icon = ({ src, alt, count, ...filteredProps }: IIcon): JSX.Element => {
|
|||
|
||||
<InlineSVG src={src} title={alt} {...filteredProps} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
);
|
||||
|
||||
export default Icon;
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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': '<rootDir>/coverage',
|
||||
'moduleDirectories': [
|
||||
|
|
Loading…
Reference in a new issue