mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 09:05:45 -06:00
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
31 lines
713 B
TypeScript
31 lines
713 B
TypeScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import { FolderPicker } from './FolderPicker';
|
|
|
|
jest.mock('@grafana/runtime', () => ({
|
|
...((jest.requireActual('@grafana/runtime') as unknown) as object),
|
|
getBackendSrv: () => ({
|
|
search: jest.fn(() => [
|
|
{ title: 'Dash 1', id: 'A' },
|
|
{ title: 'Dash 2', id: 'B' },
|
|
]),
|
|
}),
|
|
}));
|
|
|
|
jest.mock('../../config', () => ({
|
|
getConfig: () => ({}),
|
|
}));
|
|
|
|
jest.mock('app/core/services/context_srv', () => ({
|
|
contextSrv: {
|
|
user: { orgId: 1 },
|
|
},
|
|
}));
|
|
|
|
describe('FolderPicker', () => {
|
|
it('should render', () => {
|
|
const wrapper = shallow(<FolderPicker onChange={jest.fn()} />);
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|