Problems: sorting option

This commit is contained in:
Alexander Zobnin
2020-05-13 18:37:41 +03:00
parent 2588fd5c50
commit 413bf583d6
8 changed files with 36 additions and 21 deletions

View File

@@ -15,7 +15,12 @@ describe('TriggerPanelCtrl', () => {
let createPanelCtrl: () => any;
beforeEach(() => {
ctx = { scope: { panel: PANEL_DEFAULTS } };
ctx = { scope: {
panel: {
...PANEL_DEFAULTS,
sortProblems: 'lastchange',
}
}};
ctx.scope.panel.targets = [{
...DEFAULT_TARGET,
datasource: 'zabbix_default',
@@ -84,7 +89,7 @@ describe('TriggerPanelCtrl', () => {
});
it('should sort triggers by severity', (done) => {
ctx.panelCtrl.panel.sortTriggersBy = { text: 'severity', value: 'priority' };
ctx.panelCtrl.panel.sortProblems = 'priority';
ctx.panelCtrl.onDataFramesReceived(ctx.dataFramesReceived).then(() => {
const trigger_ids = _.map(ctx.panelCtrl.renderData, 'triggerid');
expect(trigger_ids).toEqual([