1
0
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:
olav 2022-04-25 09:04:30 +02:00 committed by GitHub
parent 5288438c9f
commit 76951f5d98
2 changed files with 2 additions and 116 deletions

View File

@ -5,11 +5,7 @@ import { MemoryRouter } from 'react-router-dom';
import { ThemeProvider } from '@material-ui/styles';
import theme from 'themes/mainTheme';
import AccessProvider from 'component/providers/AccessProvider/AccessProvider';
import {
ADMIN,
DELETE_TAG_TYPE,
UPDATE_TAG_TYPE,
} from 'component/providers/AccessProvider/permissions';
import { ADMIN } from 'component/providers/AccessProvider/permissions';
import UIProvider from 'component/providers/UIProvider/UIProvider';
test('renders an empty list correctly', () => {
@ -18,11 +14,7 @@ test('renders an empty list correctly', () => {
<ThemeProvider theme={theme}>
<UIProvider>
<AccessProvider permissions={[{ permission: ADMIN }]}>
<TagTypeList
tagTypes={[]}
fetchTagTypes={jest.fn()}
removeTagType={jest.fn()}
/>
<TagTypeList />
</AccessProvider>
</UIProvider>
</ThemeProvider>
@ -30,33 +22,3 @@ test('renders an empty list correctly', () => {
);
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();
});

View File

@ -1,81 +1,5 @@
// 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`] = `
<div
className="MuiPaper-root MuiPaper-elevation1 MuiPaper-rounded"