Commit 5deba92d by Erik Sundell

stackdriver: fix failing tests

parent ae8a7651
...@@ -200,11 +200,9 @@ export default class StackdriverDatasource { ...@@ -200,11 +200,9 @@ export default class StackdriverDatasource {
message = error; message = error;
} else { } else {
message = 'Stackdriver: '; message = 'Stackdriver: ';
message += error.statusText ? error.statusText + ': ' : ''; message += error.statusText ? error.statusText : defaultErrorMessage;
if (error.data && error.data.error && error.data.error.code) { if (error.data && error.data.error && error.data.error.code) {
message += error.data.error.code + '. ' + error.data.error.message; message += ': ' + error.data.error.code + '. ' + error.data.error.message;
} else {
message = defaultErrorMessage;
} }
} }
} finally { } finally {
......
...@@ -6,7 +6,7 @@ import { TemplateSrvStub } from 'test/specs/helpers'; ...@@ -6,7 +6,7 @@ import { TemplateSrvStub } from 'test/specs/helpers';
describe('StackdriverDataSource', () => { describe('StackdriverDataSource', () => {
const instanceSettings = { const instanceSettings = {
jsonData: { jsonData: {
projectName: 'testproject', defaultProject: 'testproject',
}, },
}; };
const templateSrv = new TemplateSrvStub(); const templateSrv = new TemplateSrvStub();
...@@ -54,7 +54,7 @@ describe('StackdriverDataSource', () => { ...@@ -54,7 +54,7 @@ describe('StackdriverDataSource', () => {
Promise.reject({ Promise.reject({
statusText: 'Bad Request', statusText: 'Bad Request',
data: { data: {
error: JSON.stringify({ error: { code: 400, message: 'Field interval.endTime had an invalid value' } }), error: { code: 400, message: 'Field interval.endTime had an invalid value' },
}, },
}), }),
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment