mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
refactor: remove unused props in tests (#903)
This commit is contained in:
parent
5288438c9f
commit
76951f5d98
@ -5,11 +5,7 @@ import { MemoryRouter } from 'react-router-dom';
|
|||||||
import { ThemeProvider } from '@material-ui/styles';
|
import { ThemeProvider } from '@material-ui/styles';
|
||||||
import theme from 'themes/mainTheme';
|
import theme from 'themes/mainTheme';
|
||||||
import AccessProvider from 'component/providers/AccessProvider/AccessProvider';
|
import AccessProvider from 'component/providers/AccessProvider/AccessProvider';
|
||||||
import {
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||||
ADMIN,
|
|
||||||
DELETE_TAG_TYPE,
|
|
||||||
UPDATE_TAG_TYPE,
|
|
||||||
} from 'component/providers/AccessProvider/permissions';
|
|
||||||
import UIProvider from 'component/providers/UIProvider/UIProvider';
|
import UIProvider from 'component/providers/UIProvider/UIProvider';
|
||||||
|
|
||||||
test('renders an empty list correctly', () => {
|
test('renders an empty list correctly', () => {
|
||||||
@ -18,11 +14,7 @@ test('renders an empty list correctly', () => {
|
|||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<UIProvider>
|
<UIProvider>
|
||||||
<AccessProvider permissions={[{ permission: ADMIN }]}>
|
<AccessProvider permissions={[{ permission: ADMIN }]}>
|
||||||
<TagTypeList
|
<TagTypeList />
|
||||||
tagTypes={[]}
|
|
||||||
fetchTagTypes={jest.fn()}
|
|
||||||
removeTagType={jest.fn()}
|
|
||||||
/>
|
|
||||||
</AccessProvider>
|
</AccessProvider>
|
||||||
</UIProvider>
|
</UIProvider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
@ -30,33 +22,3 @@ test('renders an empty list correctly', () => {
|
|||||||
);
|
);
|
||||||
expect(tree).toMatchSnapshot();
|
expect(tree).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('renders a list with elements correctly', () => {
|
|
||||||
const tree = renderer.create(
|
|
||||||
<ThemeProvider theme={theme}>
|
|
||||||
<MemoryRouter>
|
|
||||||
<UIProvider>
|
|
||||||
<AccessProvider
|
|
||||||
permissions={[
|
|
||||||
{ permission: UPDATE_TAG_TYPE },
|
|
||||||
{ permission: DELETE_TAG_TYPE },
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<TagTypeList
|
|
||||||
tagTypes={[
|
|
||||||
{
|
|
||||||
name: 'simple',
|
|
||||||
description: 'Some simple description',
|
|
||||||
icon: '#',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
fetchTagTypes={jest.fn()}
|
|
||||||
removeTagType={jest.fn()}
|
|
||||||
/>
|
|
||||||
</AccessProvider>
|
|
||||||
</UIProvider>
|
|
||||||
</MemoryRouter>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
expect(tree).toMatchSnapshot();
|
|
||||||
});
|
|
||||||
|
@ -1,81 +1,5 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`renders a list with elements correctly 1`] = `
|
|
||||||
<div
|
|
||||||
className="MuiPaper-root MuiPaper-elevation1 MuiPaper-rounded"
|
|
||||||
style={
|
|
||||||
Object {
|
|
||||||
"borderRadius": "10px",
|
|
||||||
"boxShadow": "none",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="makeStyles-headerContainer-1"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="makeStyles-headerTitleContainer-5"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className=""
|
|
||||||
data-loading={true}
|
|
||||||
>
|
|
||||||
<h1
|
|
||||||
className="MuiTypography-root makeStyles-headerTitle-6 MuiTypography-h1"
|
|
||||||
>
|
|
||||||
Tag Types
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="makeStyles-headerActions-7"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
className="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary"
|
|
||||||
disabled={false}
|
|
||||||
onBlur={[Function]}
|
|
||||||
onClick={[Function]}
|
|
||||||
onDragLeave={[Function]}
|
|
||||||
onFocus={[Function]}
|
|
||||||
onKeyDown={[Function]}
|
|
||||||
onKeyUp={[Function]}
|
|
||||||
onMouseDown={[Function]}
|
|
||||||
onMouseLeave={[Function]}
|
|
||||||
onMouseUp={[Function]}
|
|
||||||
onTouchEnd={[Function]}
|
|
||||||
onTouchMove={[Function]}
|
|
||||||
onTouchStart={[Function]}
|
|
||||||
tabIndex={0}
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className="MuiButton-label"
|
|
||||||
>
|
|
||||||
New tag type
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
className="MuiTouchRipple-root"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="makeStyles-bodyContainer-2"
|
|
||||||
>
|
|
||||||
<ul
|
|
||||||
className="MuiList-root MuiList-padding"
|
|
||||||
>
|
|
||||||
<li
|
|
||||||
className="MuiListItem-root MuiListItem-gutters"
|
|
||||||
disabled={false}
|
|
||||||
>
|
|
||||||
No entries
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports[`renders an empty list correctly 1`] = `
|
exports[`renders an empty list correctly 1`] = `
|
||||||
<div
|
<div
|
||||||
className="MuiPaper-root MuiPaper-elevation1 MuiPaper-rounded"
|
className="MuiPaper-root MuiPaper-elevation1 MuiPaper-rounded"
|
||||||
|
Loading…
Reference in New Issue
Block a user