mirror of
https://github.com/grafana/grafana.git
synced 2025-01-16 03:32:37 -06:00
cab6861d27
* created react component and moved markdown * extracting components * Broke out parts into components * tests * Flattened file structure * Tests * made instances typed in test * typing * function instead of variable * updated user model with missing properties * added full set of properties to user mock * redone from variable to function * refactor: minor refactorings of #13091 * removed logging
45 lines
800 B
TypeScript
45 lines
800 B
TypeScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import BottomSection from './BottomSection';
|
|
|
|
jest.mock('../../config', () => ({
|
|
bootData: {
|
|
navTree: [
|
|
{
|
|
id: 'profile',
|
|
hideFromMenu: true,
|
|
},
|
|
{
|
|
hideFromMenu: true,
|
|
},
|
|
{
|
|
hideFromMenu: false,
|
|
},
|
|
{
|
|
hideFromMenu: true,
|
|
},
|
|
],
|
|
},
|
|
user: {
|
|
orgCount: 5,
|
|
orgName: 'Grafana',
|
|
},
|
|
}));
|
|
|
|
jest.mock('app/core/services/context_srv', () => ({
|
|
contextSrv: {
|
|
sidemenu: true,
|
|
isSignedIn: false,
|
|
isGrafanaAdmin: false,
|
|
hasEditPermissionFolders: false,
|
|
},
|
|
}));
|
|
|
|
describe('Render', () => {
|
|
it('should render component', () => {
|
|
const wrapper = shallow(<BottomSection />);
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|