From 2bd04e9c229ddfd99fbca00cf2c7c480d258a32c Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Tue, 21 Jul 2020 10:12:56 +0300 Subject: [PATCH] fix tests --- src/panel-triggers/specs/panel_ctrl.spec.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/panel-triggers/specs/panel_ctrl.spec.ts b/src/panel-triggers/specs/panel_ctrl.spec.ts index 01ac55715..105861f9e 100644 --- a/src/panel-triggers/specs/panel_ctrl.spec.ts +++ b/src/panel-triggers/specs/panel_ctrl.spec.ts @@ -43,10 +43,10 @@ describe('TriggerPanelCtrl', () => { ctx.panelCtrl = createPanelCtrl(); ctx.dataFramesReceived = generateDataFramesResponse([ - {id: "1", lastchange: "1510000010", priority: 5}, - {id: "2", lastchange: "1510000040", priority: 3}, - {id: "3", lastchange: "1510000020", priority: 4}, - {id: "4", lastchange: "1510000030", priority: 2}, + {id: "1", timestamp: "1510000010", priority: 5}, + {id: "2", timestamp: "1510000040", priority: 3}, + {id: "3", timestamp: "1510000020", priority: 4}, + {id: "4", timestamp: "1510000030", priority: 2}, ]); }); @@ -168,7 +168,7 @@ const defaultProblem: any = { }; function generateDataFramesResponse(problemDescs: any[] = [{id: 1}]): any { - const problems = problemDescs.map(problem => generateProblem(problem.id, problem.lastchange, problem.priority)); + const problems = problemDescs.map(problem => generateProblem(problem.id, problem.timestamp, problem.priority)); return [ { @@ -193,11 +193,13 @@ function generateDataFramesResponse(problemDescs: any[] = [{id: 1}]): any { function generateProblem(id, timestamp?, severity?): any { const problem = _.cloneDeep(defaultProblem); problem.triggerid = id.toString(); + problem.eventid = id.toString(); if (severity) { problem.priority = severity.toString(); } if (timestamp) { problem.lastchange = timestamp; + problem.timestamp = timestamp; } return problem; }