mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
* Eslint: no-duplicate-imports rule (bump grafana-eslint-config) * Chore: Fix duplicate imports (#31041) * Rebased this branch into eslint-no-duplicate-imports * updated some changes * merged uncaught duplicate imports * fixes frontend test- I hope * fixes e2e test- I hope Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
32 lines
841 B
TypeScript
32 lines
841 B
TypeScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import { DataSourceDashboards, Props } from './DataSourceDashboards';
|
|
import { DataSourceSettings, 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();
|
|
});
|
|
});
|