mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-17 13:46:47 +02:00
fix: tests
This commit is contained in:
parent
1853f7d502
commit
b12f0b9d0d
@ -22,112 +22,22 @@ exports[`renders correctly if no application 1`] = `
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`renders correctly with permissions 1`] = `
|
exports[`renders correctly with permissions 1`] = `
|
||||||
<div
|
<div>
|
||||||
className="MuiPaper-root MuiPaper-elevation1 MuiPaper-rounded"
|
<p>
|
||||||
style={
|
Loading...
|
||||||
Object {
|
</p>
|
||||||
"borderRadius": "10px",
|
|
||||||
"boxShadow": "none",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
className="makeStyles-headerContainer-1"
|
className="MuiLinearProgress-root MuiLinearProgress-colorPrimary MuiLinearProgress-indeterminate"
|
||||||
|
role="progressbar"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="makeStyles-headerTitleContainer-5"
|
className="MuiLinearProgress-bar MuiLinearProgress-barColorPrimary MuiLinearProgress-bar1Indeterminate"
|
||||||
>
|
style={Object {}}
|
||||||
<div
|
/>
|
||||||
className=""
|
<div
|
||||||
data-loading={true}
|
className="MuiLinearProgress-bar MuiLinearProgress-bar2Indeterminate MuiLinearProgress-barColorPrimary"
|
||||||
>
|
style={Object {}}
|
||||||
<h2
|
/>
|
||||||
className="MuiTypography-root makeStyles-headerTitle-6 MuiTypography-h2"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
style={
|
|
||||||
Object {
|
|
||||||
"alignItems": "center",
|
|
||||||
"display": "flex",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="MuiAvatar-root MuiAvatar-circular MuiAvatar-colorDefault"
|
|
||||||
style={
|
|
||||||
Object {
|
|
||||||
"marginRight": "8px",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
aria-hidden={true}
|
|
||||||
className="material-icons MuiIcon-root"
|
|
||||||
>
|
|
||||||
apps
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
test-app
|
|
||||||
</span>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="makeStyles-headerActions-7"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
aria-disabled={false}
|
|
||||||
className="MuiTypography-root MuiLink-root MuiLink-underlineHover MuiButtonBase-root MuiIconButton-root MuiTypography-colorPrimary"
|
|
||||||
href="http://example.org"
|
|
||||||
onBlur={[Function]}
|
|
||||||
onDragLeave={[Function]}
|
|
||||||
onFocus={[Function]}
|
|
||||||
onKeyDown={[Function]}
|
|
||||||
onKeyUp={[Function]}
|
|
||||||
onMouseDown={[Function]}
|
|
||||||
onMouseLeave={[Function]}
|
|
||||||
onMouseUp={[Function]}
|
|
||||||
onTouchEnd={[Function]}
|
|
||||||
onTouchMove={[Function]}
|
|
||||||
onTouchStart={[Function]}
|
|
||||||
role="button"
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className="MuiIconButton-label"
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
aria-hidden={true}
|
|
||||||
className="MuiSvgIcon-root"
|
|
||||||
focusable="false"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="makeStyles-bodyContainer-2"
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<p
|
|
||||||
className="MuiTypography-root MuiTypography-body1"
|
|
||||||
>
|
|
||||||
app description
|
|
||||||
</p>
|
|
||||||
<p
|
|
||||||
className="MuiTypography-root MuiTypography-body2"
|
|
||||||
>
|
|
||||||
Created:
|
|
||||||
<strong>
|
|
||||||
Invalid Date
|
|
||||||
</strong>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@ -178,47 +88,12 @@ exports[`renders correctly without permission 1`] = `
|
|||||||
apps
|
apps
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
test-app
|
|
||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="makeStyles-headerActions-7"
|
className="makeStyles-headerActions-7"
|
||||||
>
|
/>
|
||||||
<a
|
|
||||||
aria-disabled={false}
|
|
||||||
className="MuiTypography-root MuiLink-root MuiLink-underlineHover MuiButtonBase-root MuiIconButton-root MuiTypography-colorPrimary"
|
|
||||||
href="http://example.org"
|
|
||||||
onBlur={[Function]}
|
|
||||||
onDragLeave={[Function]}
|
|
||||||
onFocus={[Function]}
|
|
||||||
onKeyDown={[Function]}
|
|
||||||
onKeyUp={[Function]}
|
|
||||||
onMouseDown={[Function]}
|
|
||||||
onMouseLeave={[Function]}
|
|
||||||
onMouseUp={[Function]}
|
|
||||||
onTouchEnd={[Function]}
|
|
||||||
onTouchMove={[Function]}
|
|
||||||
onTouchStart={[Function]}
|
|
||||||
role="button"
|
|
||||||
tabIndex={0}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className="MuiIconButton-label"
|
|
||||||
>
|
|
||||||
<svg
|
|
||||||
aria-hidden={true}
|
|
||||||
className="MuiSvgIcon-root"
|
|
||||||
focusable="false"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@ -228,14 +103,14 @@ exports[`renders correctly without permission 1`] = `
|
|||||||
<p
|
<p
|
||||||
className="MuiTypography-root MuiTypography-body1"
|
className="MuiTypography-root MuiTypography-body1"
|
||||||
>
|
>
|
||||||
app description
|
|
||||||
</p>
|
</p>
|
||||||
<p
|
<p
|
||||||
className="MuiTypography-root MuiTypography-body2"
|
className="MuiTypography-root MuiTypography-body2"
|
||||||
>
|
>
|
||||||
Created:
|
Created:
|
||||||
<strong>
|
<strong>
|
||||||
Invalid Date
|
02/02/2022
|
||||||
</strong>
|
</strong>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { ThemeProvider } from '@material-ui/core';
|
import { ThemeProvider } from '@material-ui/core';
|
||||||
import ClientApplications from '../application-edit-component';
|
import ApplicationEdit from '../ApplicationEdit';
|
||||||
import renderer from 'react-test-renderer';
|
import renderer from 'react-test-renderer';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
import { MemoryRouter } from 'react-router-dom';
|
||||||
import { ADMIN } from '../../providers/AccessProvider/permissions';
|
import { ADMIN } from '../../providers/AccessProvider/permissions';
|
||||||
import theme from '../../../themes/main-theme';
|
import theme from '../../../themes/main-theme';
|
||||||
|
|
||||||
import { createFakeStore } from '../../../accessStoreFake';
|
import { createFakeStore } from '../../../accessStoreFake';
|
||||||
import AccessProvider from '../../providers/AccessProvider/AccessProvider';
|
import AccessProvider from '../../providers/AccessProvider/AccessProvider';
|
||||||
|
|
||||||
@ -14,13 +11,17 @@ test('renders correctly if no application', () => {
|
|||||||
const tree = renderer
|
const tree = renderer
|
||||||
.create(
|
.create(
|
||||||
<AccessProvider store={createFakeStore([{ permission: ADMIN }])}>
|
<AccessProvider store={createFakeStore([{ permission: ADMIN }])}>
|
||||||
<ClientApplications
|
<ThemeProvider theme={theme}>
|
||||||
fetchApplication={() => Promise.resolve({})}
|
<MemoryRouter initialEntries={['/test']}>
|
||||||
storeApplicationMetaData={jest.fn()}
|
<ApplicationEdit
|
||||||
deleteApplication={jest.fn()}
|
fetchApplication={() => Promise.resolve({})}
|
||||||
history={{}}
|
storeApplicationMetaData={jest.fn()}
|
||||||
locationSettings={{ locale: 'en-GB' }}
|
deleteApplication={jest.fn()}
|
||||||
/>
|
history={{}}
|
||||||
|
locationSettings={{ locale: 'en-GB' }}
|
||||||
|
/>
|
||||||
|
</MemoryRouter>
|
||||||
|
</ThemeProvider>
|
||||||
</AccessProvider>
|
</AccessProvider>
|
||||||
)
|
)
|
||||||
.toJSON();
|
.toJSON();
|
||||||
@ -34,7 +35,7 @@ test('renders correctly without permission', () => {
|
|||||||
<MemoryRouter>
|
<MemoryRouter>
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<AccessProvider store={createFakeStore([])}>
|
<AccessProvider store={createFakeStore([])}>
|
||||||
<ClientApplications
|
<ApplicationEdit
|
||||||
fetchApplication={() => Promise.resolve({})}
|
fetchApplication={() => Promise.resolve({})}
|
||||||
storeApplicationMetaData={jest.fn()}
|
storeApplicationMetaData={jest.fn()}
|
||||||
deleteApplication={jest.fn()}
|
deleteApplication={jest.fn()}
|
||||||
@ -97,7 +98,7 @@ test('renders correctly with permissions', () => {
|
|||||||
<AccessProvider
|
<AccessProvider
|
||||||
store={createFakeStore([{ permission: ADMIN }])}
|
store={createFakeStore([{ permission: ADMIN }])}
|
||||||
>
|
>
|
||||||
<ClientApplications
|
<ApplicationEdit
|
||||||
fetchApplication={() => Promise.resolve({})}
|
fetchApplication={() => Promise.resolve({})}
|
||||||
storeApplicationMetaData={jest.fn()}
|
storeApplicationMetaData={jest.fn()}
|
||||||
history={{}}
|
history={{}}
|
||||||
|
Loading…
Reference in New Issue
Block a user