chore: mocks plugin loader for DataSourceSettingsPage tests (#17157)

Properly mocks the plugin loader in DataSourceSettingsPage tests 
and by that removes console logs.
This commit is contained in:
Marcus Efraimsson 2019-05-20 11:41:22 +02:00 committed by GitHub
parent 058f5a1682
commit a564a54b13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,12 @@ import { setDataSourceName, setIsDefault } from '../state/actions';
const pluginMock = new DataSourcePlugin({} as DataSourceConstructor<any>);
jest.mock('app/features/plugins/plugin_loader', () => {
return {
importDataSourcePlugin: () => Promise.resolve(pluginMock),
};
});
const setup = (propOverrides?: object) => {
const props: Props = {
navModel: {} as NavModel,