From 6200328afca7bea27376218ce7c11a0b0ae997af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 10 Sep 2019 18:35:31 +0100 Subject: [PATCH] chore(ci): set different alert start for storybook snapshots --- ui/src/Components/Grid/index.stories.js | 58 +++++++++++++------------ 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/ui/src/Components/Grid/index.stories.js b/ui/src/Components/Grid/index.stories.js index ab3fc7ca6..ff61ce318 100644 --- a/ui/src/Components/Grid/index.stories.js +++ b/ui/src/Components/Grid/index.stories.js @@ -4,6 +4,8 @@ import { storiesOf } from "@storybook/react"; import { Provider } from "mobx-react"; +import moment from "moment"; + import { MockAlert, MockAlertGroup } from "__mocks__/Alerts.js"; import { AlertStore } from "Stores/AlertStore"; import { Settings } from "Stores/Settings"; @@ -29,34 +31,36 @@ const MockGroup = (groupName, alertCount, active, suppressed, unprocessed) => { default: state = "active"; } - alerts.push( - MockAlert( - alertCount < 4 - ? [ - { - name: "dashboard", - value: "http://localhost", - visible: true, - isLink: true - }, - { - name: "help", - value: "this is a summary text", - visible: true, - isLink: false - }, - { - name: "hidden", - value: "this is hidden by default", - visible: false, - isLink: false - } - ] - : [], - { instance: `instance${i}` }, - state - ) + const alert = MockAlert( + alertCount < 4 + ? [ + { + name: "dashboard", + value: "http://localhost", + visible: true, + isLink: true + }, + { + name: "help", + value: "this is a summary text", + visible: true, + isLink: false + }, + { + name: "hidden", + value: "this is hidden by default", + visible: false, + isLink: false + } + ] + : [], + { instance: `instance${i}` }, + state ); + alert.startsAt = moment() + .subtract(alertCount, "minutes") + .toISOString(); + alerts.push(alert); } const group = MockAlertGroup( { alertname: "Fake Alert", group: groupName },