fix panel migration tests
This commit is contained in:
@@ -56,10 +56,17 @@ describe('Triggers Panel schema migration', () => {
|
||||
|
||||
const expected = _.defaultsDeep({
|
||||
schemaVersion: CURRENT_SCHEMA_VERSION,
|
||||
datasource: 'zabbix',
|
||||
targets: [
|
||||
{
|
||||
...DEFAULT_TARGET,
|
||||
datasource: 'zabbix',
|
||||
queryType: 5,
|
||||
options: {
|
||||
hostsInMaintenance: true,
|
||||
showTriggers: 'all triggers',
|
||||
sortTriggersBy: { text: 'last change', value: 'lastchange' },
|
||||
showEvents: { text: 'Problems', value: 1 },
|
||||
}
|
||||
}
|
||||
],
|
||||
ageField: true,
|
||||
@@ -79,27 +86,7 @@ describe('Triggers Panel schema migration', () => {
|
||||
|
||||
const expected = _.defaultsDeep({
|
||||
schemaVersion: CURRENT_SCHEMA_VERSION,
|
||||
targets: [{
|
||||
...DEFAULT_TARGET,
|
||||
datasource: 'zabbix_default'
|
||||
}]
|
||||
}, PANEL_DEFAULTS);
|
||||
expect(updatedPanelCtrl.panel).toEqual(expected);
|
||||
});
|
||||
|
||||
it('should set default targets for new panel with empty targets', () => {
|
||||
ctx.scope.panel = {
|
||||
targets: []
|
||||
};
|
||||
const updatedPanelCtrl = updatePanelCtrl(ctx.scope);
|
||||
|
||||
const expected = _.defaultsDeep({
|
||||
targets: [{
|
||||
...DEFAULT_TARGET,
|
||||
datasource: 'zabbix_default'
|
||||
}]
|
||||
}, PANEL_DEFAULTS);
|
||||
|
||||
expect(updatedPanelCtrl.panel).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user