mirror of
https://github.com/grafana/grafana.git
synced 2025-02-09 23:16:16 -06:00
Primarily- moving majority of the types and utils from @grafana/ui to @grafana/data * Move types from grafana-ui to grafana-data * Move valueFormats to grafana-data * Move utils from grafana-ui to grafana-data * Update imports in grafana-ui * revert data's tsconfig change * Update imports in grafana-runtime * Fix import paths in grafana-ui * Move rxjs to devDeps * Core import updates batch 1 * Import updates batch 2 * Imports fix batch 3 * Imports fixes batch i don't know * Fix imorts in grafana-toolkit * Fix imports after master merge
33 lines
873 B
TypeScript
33 lines
873 B
TypeScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import { DataSourceDashboards, Props } from './DataSourceDashboards';
|
|
import { DataSourceSettings } from '@grafana/data';
|
|
import { NavModel } from '@grafana/data';
|
|
import { PluginDashboard } from 'app/types';
|
|
|
|
const setup = (propOverrides?: object) => {
|
|
const props: Props = {
|
|
navModel: {} as NavModel,
|
|
dashboards: [] as PluginDashboard[],
|
|
dataSource: {} as DataSourceSettings,
|
|
pageId: 1,
|
|
importDashboard: jest.fn(),
|
|
loadDataSource: jest.fn(),
|
|
loadPluginDashboards: jest.fn(),
|
|
removeDashboard: jest.fn(),
|
|
isLoading: false,
|
|
};
|
|
|
|
Object.assign(props, propOverrides);
|
|
|
|
return shallow(<DataSourceDashboards {...props} />);
|
|
};
|
|
|
|
describe('Render', () => {
|
|
it('should render component', () => {
|
|
const wrapper = setup();
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|