fix tests (add mocks for some grafana modules)

This commit is contained in:
Alexander Zobnin
2019-07-08 15:45:50 +03:00
parent bf014b600b
commit 7727d86804

View File

@@ -18,6 +18,12 @@ jest.mock('angular', () => {
};
}, {virtual: true});
jest.mock('grafana/app/core/core_module', () => {
return {
directive: function() {},
};
}, {virtual: true});
let mockPanelCtrl = PanelCtrl;
jest.mock('grafana/app/plugins/sdk', () => {
return {
@@ -62,6 +68,10 @@ jest.mock('grafana/app/core/config', () => {
jest.mock('jquery', () => 'module not found', {virtual: true});
jest.mock('@grafana/ui', () => {
return {};
}, {virtual: true});
// Required for loading angularjs
let dom = new JSDOM('<html><head><script></script></head><body></body></html>');
// Setup jsdom