Silence prop warnings in test suite

next-interactions
Justin 2022-04-04 15:05:15 -04:00
rodzic dcc90bc99a
commit 827bca3fd6
8 zmienionych plików z 14 dodań i 19 usunięć

Wyświetl plik

@ -6,5 +6,5 @@ export default function InlineSVG({ src }) {
}
InlineSVG.propTypes = {
src: PropTypes.node.isRequired,
src: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
};

Wyświetl plik

@ -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,
};

Wyświetl plik

@ -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,
};

Wyświetl plik

@ -8,18 +8,16 @@ interface IIcon {
src: string,
}
const Icon = ({ src, alt, count, ...filteredProps }: IIcon): JSX.Element => {
return (
<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'>
{count}
</span>
) : null}
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'>
{count}
</span>
) : null}
<InlineSVG src={src} title={alt} {...filteredProps} />
</div>
);
};
<InlineSVG src={src} title={alt} {...filteredProps} />
</div>
);
export default Icon;

Wyświetl plik

@ -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';

Wyświetl plik

@ -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';

Wyświetl plik

@ -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';

Wyświetl plik

@ -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': [