mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: test and update snapshot
This commit is contained in:
		
							parent
							
								
									5a05bb44a6
								
							
						
					
					
						commit
						ac7ae9c8a1
					
				@ -43,77 +43,22 @@ exports[`renders correctly with permissions 1`] = `
 | 
			
		||||
`;
 | 
			
		||||
 | 
			
		||||
exports[`renders correctly without permission 1`] = `
 | 
			
		||||
<div>
 | 
			
		||||
  <p>
 | 
			
		||||
    Loading...
 | 
			
		||||
  </p>
 | 
			
		||||
  <div
 | 
			
		||||
  className="MuiPaper-root MuiPaper-elevation1 MuiPaper-rounded"
 | 
			
		||||
  style={
 | 
			
		||||
    Object {
 | 
			
		||||
      "borderRadius": "10px",
 | 
			
		||||
      "boxShadow": "none",
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
    className="MuiLinearProgress-root MuiLinearProgress-colorPrimary MuiLinearProgress-indeterminate"
 | 
			
		||||
    role="progressbar"
 | 
			
		||||
  >
 | 
			
		||||
    <div
 | 
			
		||||
    className="makeStyles-headerContainer-1"
 | 
			
		||||
  >
 | 
			
		||||
      className="MuiLinearProgress-bar MuiLinearProgress-barColorPrimary MuiLinearProgress-bar1Indeterminate"
 | 
			
		||||
      style={Object {}}
 | 
			
		||||
    />
 | 
			
		||||
    <div
 | 
			
		||||
      className="makeStyles-headerTitleContainer-5"
 | 
			
		||||
    >
 | 
			
		||||
      <div
 | 
			
		||||
        className=""
 | 
			
		||||
        data-loading={true}
 | 
			
		||||
      >
 | 
			
		||||
        <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>
 | 
			
		||||
          </span>
 | 
			
		||||
        </h2>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div
 | 
			
		||||
        className="makeStyles-headerActions-7"
 | 
			
		||||
      className="MuiLinearProgress-bar MuiLinearProgress-bar2Indeterminate MuiLinearProgress-barColorPrimary"
 | 
			
		||||
      style={Object {}}
 | 
			
		||||
    />
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
  <div
 | 
			
		||||
    className="makeStyles-bodyContainer-2"
 | 
			
		||||
  >
 | 
			
		||||
    <div>
 | 
			
		||||
      <p
 | 
			
		||||
        className="MuiTypography-root MuiTypography-body1"
 | 
			
		||||
      >
 | 
			
		||||
        
 | 
			
		||||
      </p>
 | 
			
		||||
      <p
 | 
			
		||||
        className="MuiTypography-root MuiTypography-body2"
 | 
			
		||||
      >
 | 
			
		||||
        Created: 
 | 
			
		||||
        <strong>
 | 
			
		||||
          02/02/2022
 | 
			
		||||
        </strong>
 | 
			
		||||
      </p>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
`;
 | 
			
		||||
 | 
			
		||||
@ -1,17 +1,19 @@
 | 
			
		||||
import { ThemeProvider } from '@material-ui/core';
 | 
			
		||||
import ApplicationEdit from '../ApplicationEdit/ApplicationEdit';
 | 
			
		||||
import { ApplicationEdit } from '../ApplicationEdit/ApplicationEdit';
 | 
			
		||||
import renderer from 'react-test-renderer';
 | 
			
		||||
import { MemoryRouter } from 'react-router-dom';
 | 
			
		||||
import { ADMIN } from '../../providers/AccessProvider/permissions';
 | 
			
		||||
import theme from '../../../themes/main-theme';
 | 
			
		||||
import { createFakeStore } from '../../../accessStoreFake';
 | 
			
		||||
import AccessProvider from '../../providers/AccessProvider/AccessProvider';
 | 
			
		||||
import UIProvider from '../../providers/UIProvider/UIProvider';
 | 
			
		||||
 | 
			
		||||
test('renders correctly if no application', () => {
 | 
			
		||||
    const tree = renderer
 | 
			
		||||
        .create(
 | 
			
		||||
            <AccessProvider store={createFakeStore([{ permission: ADMIN }])}>
 | 
			
		||||
                <ThemeProvider theme={theme}>
 | 
			
		||||
                    <UIProvider>
 | 
			
		||||
                        <MemoryRouter initialEntries={['/test']}>
 | 
			
		||||
                            <ApplicationEdit
 | 
			
		||||
                                fetchApplication={() => Promise.resolve({})}
 | 
			
		||||
@ -21,6 +23,7 @@ test('renders correctly if no application', () => {
 | 
			
		||||
                                locationSettings={{ locale: 'en-GB' }}
 | 
			
		||||
                            />
 | 
			
		||||
                        </MemoryRouter>
 | 
			
		||||
                    </UIProvider>
 | 
			
		||||
                </ThemeProvider>
 | 
			
		||||
            </AccessProvider>
 | 
			
		||||
        )
 | 
			
		||||
@ -34,6 +37,7 @@ test('renders correctly without permission', () => {
 | 
			
		||||
        .create(
 | 
			
		||||
            <MemoryRouter>
 | 
			
		||||
                <ThemeProvider theme={theme}>
 | 
			
		||||
                    <UIProvider>
 | 
			
		||||
                        <AccessProvider store={createFakeStore([])}>
 | 
			
		||||
                            <ApplicationEdit
 | 
			
		||||
                                fetchApplication={() => Promise.resolve({})}
 | 
			
		||||
@ -82,6 +86,7 @@ test('renders correctly without permission', () => {
 | 
			
		||||
                                locationSettings={{ locale: 'en-GB' }}
 | 
			
		||||
                            />
 | 
			
		||||
                        </AccessProvider>
 | 
			
		||||
                    </UIProvider>
 | 
			
		||||
                </ThemeProvider>
 | 
			
		||||
            </MemoryRouter>
 | 
			
		||||
        )
 | 
			
		||||
@ -95,6 +100,7 @@ test('renders correctly with permissions', () => {
 | 
			
		||||
        .create(
 | 
			
		||||
            <MemoryRouter>
 | 
			
		||||
                <ThemeProvider theme={theme}>
 | 
			
		||||
                    <UIProvider>
 | 
			
		||||
                        <AccessProvider
 | 
			
		||||
                            store={createFakeStore([{ permission: ADMIN }])}
 | 
			
		||||
                        >
 | 
			
		||||
@ -145,6 +151,7 @@ test('renders correctly with permissions', () => {
 | 
			
		||||
                                locationSettings={{ locale: 'en-GB' }}
 | 
			
		||||
                            />
 | 
			
		||||
                        </AccessProvider>
 | 
			
		||||
                    </UIProvider>
 | 
			
		||||
                </ThemeProvider>
 | 
			
		||||
            </MemoryRouter>
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user