Skip to content

Commit

Permalink
Fix test data set to use correct timestamps, and assign "remove older…
Browse files Browse the repository at this point in the history
…" date for the chart
  • Loading branch information
joepavitt committed Nov 29, 2024
1 parent e55934a commit c1c5a12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cypress/fixtures/flows/dashboard-charts.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@
"pointShape": "circle",
"pointRadius": 4,
"showLegend": true,
"removeOlder": 1,
"removeOlderUnit": "3600",
"removeOlder": 1000000,
"removeOlderUnit": "604800",
"removeOlderPoints": "",
"colors": [
"#1f77b4",
Expand Down Expand Up @@ -286,7 +286,7 @@
"className": "",
"icon": "",
"iconPosition": "left",
"payload": "[{\"location\":\"New York\",\"temp\":56,\"datestamp\":1643784000},{\"location\":\"Los Angeles\",\"temp\":67,\"datestamp\":1643784000},{\"location\":\"Chicago\",\"temp\":44,\"datestamp\":1643784000},{\"location\":\"New York\",\"temp\":60,\"datestamp\":1643798400},{\"location\":\"Los Angeles\",\"temp\":71,\"datestamp\":1643798400},{\"location\":\"Chicago\",\"temp\":48,\"datestamp\":1643798400},{\"location\":\"New York\",\"temp\":65,\"datestamp\":1643812800},{\"location\":\"Los Angeles\",\"temp\":74,\"datestamp\":1643812800},{\"location\":\"Chicago\",\"temp\":52,\"datestamp\":1643812800},{\"location\":\"New York\",\"temp\":69,\"datestamp\":1643827200},{\"location\":\"Los Angeles\",\"temp\":77,\"datestamp\":1643827200},{\"location\":\"Chicago\",\"temp\":56,\"datestamp\":1643827200},{\"location\":\"New York\",\"temp\":73,\"datestamp\":1643841600},{\"location\":\"Los Angeles\",\"temp\":80,\"datestamp\":1643841600},{\"location\":\"Chicago\",\"temp\":60,\"datestamp\":1643841600},{\"location\":\"New York\",\"temp\":77,\"datestamp\":1643856000},{\"location\":\"Los Angeles\",\"temp\":82,\"datestamp\":1643856000},{\"location\":\"Chicago\",\"temp\":64,\"datestamp\":1643856000},{\"location\":\"New York\",\"temp\":80,\"datestamp\":1643870400},{\"location\":\"Los Angeles\",\"temp\":84,\"datestamp\":1643870400},{\"location\":\"Chicago\",\"temp\":68,\"datestamp\":1643870400},{\"location\":\"New York\",\"temp\":83,\"datestamp\":1643884800},{\"location\":\"Los Angeles\",\"temp\":86,\"datestamp\":1643884800},{\"location\":\"Chicago\",\"temp\":72,\"datestamp\":1643884800},{\"location\":\"New York\",\"temp\":86,\"datestamp\":1643899200},{\"location\":\"Los Angeles\",\"temp\":88,\"datestamp\":1643899200},{\"location\":\"Chicago\",\"temp\":76,\"datestamp\":1643899200},{\"location\":\"New York\",\"temp\":89,\"datestamp\":1643913600},{\"location\":\"Los Angeles\",\"temp\":89,\"datestamp\":1643913600},{\"location\":\"Chicago\",\"temp\":80,\"datestamp\":1643913600},{\"location\":\"New York\",\"temp\":89,\"datestamp\":1643928000},{\"location\":\"Los Angeles\",\"temp\":88,\"datestamp\":1643928000},{\"location\":\"Chicago\",\"temp\":84,\"datestamp\":1643928000},{\"location\":\"New York\",\"temp\":86,\"datestamp\":1643942400},{\"location\":\"Los Angeles\",\"temp\":86,\"datestamp\":1643942400},{\"location\":\"Chicago\",\"temp\":88,\"datestamp\":1643942400},{\"location\":\"New York\",\"temp\":83,\"datestamp\":1643956800},{\"location\":\"Los Angeles\",\"temp\":84,\"datestamp\":1643956800},{\"location\":\"Chicago\",\"temp\":92,\"datestamp\":1643956800},{\"location\":\"New York\",\"temp\":79,\"datestamp\":1643971200},{\"location\":\"Los Angeles\",\"temp\":82,\"datestamp\":1643971200},{\"location\":\"Chicago\",\"temp\":96,\"datestamp\":1643971200},{\"location\":\"New York\",\"temp\":73,\"datestamp\":1643985600},{\"location\":\"Los Angeles\",\"temp\":80,\"datestamp\":1643985600},{\"location\":\"Chicago\",\"temp\":100,\"datestamp\":1643985600},{\"location\":\"New York\",\"temp\":66,\"datestamp\":1644000000},{\"location\":\"Los Angeles\",\"temp\":78,\"datestamp\":1644000000},{\"location\":\"Chicago\",\"temp\":96,\"datestamp\":1644000000},{\"location\":\"New York\",\"temp\":59,\"datestamp\":1644014400},{\"location\":\"Los Angeles\",\"temp\":76,\"datestamp\":1644014400},{\"location\":\"Chicago\",\"temp\":92,\"datestamp\":1644014400},{\"location\":\"New York\",\"temp\":53,\"datestamp\":1644028800},{\"location\":\"Los Angeles\",\"temp\":74,\"datestamp\":1644028800},{\"location\":\"Chicago\",\"temp\":88,\"datestamp\":1644028800},{\"location\":\"New York\",\"temp\":47,\"datestamp\":1644043200},{\"location\":\"Los Angeles\",\"temp\":72,\"datestamp\":1644043200},{\"location\":\"Chicago\",\"temp\":84,\"datestamp\":1644043200},{\"location\":\"New York\",\"temp\":42,\"datestamp\":1644057600},{\"location\":\"Los Angeles\",\"temp\":70,\"datestamp\":1644057600},{\"location\":\"Chicago\",\"temp\":80,\"datestamp\":1644057600},{\"location\":\"New York\",\"temp\":39,\"datestamp\":1644072000},{\"location\":\"Los Angeles\",\"temp\":68,\"datestamp\":1644072000},{\"location\":\"Chicago\",\"temp\":76,\"datestamp\":1644072000},{\"location\":\"New York\",\"temp\":37,\"datestamp\":1644086400},{\"location\":\"Los Angeles\",\"temp\":66,\"datestamp\":1644086400},{\"location\":\"Chicago\",\"temp\":72,\"datestamp\":1644086400},{\"location\":\"New York\",\"temp\":36,\"datestamp\":1644100800},{\"location\":\"Los Angeles\",\"temp\":64,\"datestamp\":1644100800},{\"location\":\"Chicago\",\"temp\":68,\"datestamp\":1644100800},{\"location\":\"New York\",\"temp\":37,\"datestamp\":1644115200},{\"location\":\"Los Angeles\",\"temp\":62,\"datestamp\":1644115200},{\"location\":\"Chicago\",\"temp\":64,\"datestamp\":1644115200}]",
"payload": "[{\"location\":\"New York\",\"temp\":56,\"datestamp\":1643784000000},{\"location\":\"Los Angeles\",\"temp\":67,\"datestamp\":1643784000000},{\"location\":\"Chicago\",\"temp\":44,\"datestamp\":1643784000000},{\"location\":\"New York\",\"temp\":60,\"datestamp\":1643798400000},{\"location\":\"Los Angeles\",\"temp\":71,\"datestamp\":1643798400000},{\"location\":\"Chicago\",\"temp\":48,\"datestamp\":1643798400000},{\"location\":\"New York\",\"temp\":65,\"datestamp\":1643812800000},{\"location\":\"Los Angeles\",\"temp\":74,\"datestamp\":1643812800000},{\"location\":\"Chicago\",\"temp\":52,\"datestamp\":1643812800000},{\"location\":\"New York\",\"temp\":69,\"datestamp\":1643827200000},{\"location\":\"Los Angeles\",\"temp\":77,\"datestamp\":1643827200000},{\"location\":\"Chicago\",\"temp\":56,\"datestamp\":1643827200000},{\"location\":\"New York\",\"temp\":73,\"datestamp\":1643841600000},{\"location\":\"Los Angeles\",\"temp\":80,\"datestamp\":1643841600000},{\"location\":\"Chicago\",\"temp\":60,\"datestamp\":1643841600000},{\"location\":\"New York\",\"temp\":77,\"datestamp\":1643856000000},{\"location\":\"Los Angeles\",\"temp\":82,\"datestamp\":1643856000000},{\"location\":\"Chicago\",\"temp\":64,\"datestamp\":1643856000000},{\"location\":\"New York\",\"temp\":80,\"datestamp\":1643870400000},{\"location\":\"Los Angeles\",\"temp\":84,\"datestamp\":1643870400000},{\"location\":\"Chicago\",\"temp\":68,\"datestamp\":1643870400},{\"location\":\"New York\",\"temp\":83,\"datestamp\":1643884800000},{\"location\":\"Los Angeles\",\"temp\":86,\"datestamp\":1643884800000},{\"location\":\"Chicago\",\"temp\":72,\"datestamp\":1643884800000},{\"location\":\"New York\",\"temp\":86,\"datestamp\":1643899200000},{\"location\":\"Los Angeles\",\"temp\":88,\"datestamp\":1643899200000},{\"location\":\"Chicago\",\"temp\":76,\"datestamp\":1643899200000},{\"location\":\"New York\",\"temp\":89,\"datestamp\":16439136000000},{\"location\":\"Los Angeles\",\"temp\":89,\"datestamp\":1643913600000},{\"location\":\"Chicago\",\"temp\":80,\"datestamp\":1643913600000},{\"location\":\"New York\",\"temp\":89,\"datestamp\":1643928000000},{\"location\":\"Los Angeles\",\"temp\":88,\"datestamp\":1643928000000},{\"location\":\"Chicago\",\"temp\":84,\"datestamp\":1643928000000},{\"location\":\"New York\",\"temp\":86,\"datestamp\":1643942400000},{\"location\":\"Los Angeles\",\"temp\":86,\"datestamp\":1643942400000},{\"location\":\"Chicago\",\"temp\":88,\"datestamp\":1643942400000},{\"location\":\"New York\",\"temp\":83,\"datestamp\":1643956800000},{\"location\":\"Los Angeles\",\"temp\":84,\"datestamp\":1643956800000},{\"location\":\"Chicago\",\"temp\":92,\"datestamp\":1643956800000},{\"location\":\"New York\",\"temp\":79,\"datestamp\":1643971200000},{\"location\":\"Los Angeles\",\"temp\":82,\"datestamp\":1643971200000},{\"location\":\"Chicago\",\"temp\":96,\"datestamp\":1643971200000},{\"location\":\"New York\",\"temp\":73,\"datestamp\":1643985600000},{\"location\":\"Los Angeles\",\"temp\":80,\"datestamp\":1643985600000},{\"location\":\"Chicago\",\"temp\":100,\"datestamp\":1643985600000},{\"location\":\"New York\",\"temp\":66,\"datestamp\":1644000000000000},{\"location\":\"Los Angeles\",\"temp\":78,\"datestamp\":1644000000000},{\"location\":\"Chicago\",\"temp\":96,\"datestamp\":1644000000000},{\"location\":\"New York\",\"temp\":59,\"datestamp\":1644014400000},{\"location\":\"Los Angeles\",\"temp\":76,\"datestamp\":1644014400000},{\"location\":\"Chicago\",\"temp\":92,\"datestamp\":1644014400000},{\"location\":\"New York\",\"temp\":53,\"datestamp\":1644028800000},{\"location\":\"Los Angeles\",\"temp\":74,\"datestamp\":1644028800000},{\"location\":\"Chicago\",\"temp\":88,\"datestamp\":1644028800000},{\"location\":\"New York\",\"temp\":47,\"datestamp\":1644043200000},{\"location\":\"Los Angeles\",\"temp\":72,\"datestamp\":1644043200000},{\"location\":\"Chicago\",\"temp\":84,\"datestamp\":1644043200000},{\"location\":\"New York\",\"temp\":42,\"datestamp\":1644057600000},{\"location\":\"Los Angeles\",\"temp\":70,\"datestamp\":1644057600000},{\"location\":\"Chicago\",\"temp\":80,\"datestamp\":1644057600000},{\"location\":\"New York\",\"temp\":39,\"datestamp\":1644072000000},{\"location\":\"Los Angeles\",\"temp\":68,\"datestamp\":1644072000000},{\"location\":\"Chicago\",\"temp\":76,\"datestamp\":1644072000000},{\"location\":\"New York\",\"temp\":37,\"datestamp\":1644086400000},{\"location\":\"Los Angeles\",\"temp\":66,\"datestamp\":1644086400000},{\"location\":\"Chicago\",\"temp\":72,\"datestamp\":1644086400000},{\"location\":\"New York\",\"temp\":36,\"datestamp\":1644100800000},{\"location\":\"Los Angeles\",\"temp\":64,\"datestamp\":1644100800000},{\"location\":\"Chicago\",\"temp\":68,\"datestamp\":1644100800000},{\"location\":\"New York\",\"temp\":37,\"datestamp\":1644115200000},{\"location\":\"Los Angeles\",\"temp\":62,\"datestamp\":1644115200000},{\"location\":\"Chicago\",\"temp\":64,\"datestamp\":1644115200000}]",
"payloadType": "json",
"topic": "topic",
"topicType": "msg",
Expand Down
2 changes: 1 addition & 1 deletion cypress/tests/widgets/chart.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe.only('Node/-RED Dashboard 2.0 - Chart Widget', () => {

// multi line chart: uses a copy of the data from the chart fixture for the test
// eslint-disable-next-line comma-spacing, quote-props, key-spacing, quotes, object-curly-spacing
const data = [{"location":"New York","temp":56,"datestamp":1643784000},{"location":"Los Angeles","temp":67,"datestamp":1643784000},{"location":"Chicago","temp":44,"datestamp":1643784000},{"location":"New York","temp":60,"datestamp":1643798400},{"location":"Los Angeles","temp":71,"datestamp":1643798400},{"location":"Chicago","temp":48,"datestamp":1643798400},{"location":"New York","temp":65,"datestamp":1643812800},{"location":"Los Angeles","temp":74,"datestamp":1643812800},{"location":"Chicago","temp":52,"datestamp":1643812800},{"location":"New York","temp":69,"datestamp":1643827200},{"location":"Los Angeles","temp":77,"datestamp":1643827200},{"location":"Chicago","temp":56,"datestamp":1643827200},{"location":"New York","temp":73,"datestamp":1643841600},{"location":"Los Angeles","temp":80,"datestamp":1643841600},{"location":"Chicago","temp":60,"datestamp":1643841600},{"location":"New York","temp":77,"datestamp":1643856000},{"location":"Los Angeles","temp":82,"datestamp":1643856000},{"location":"Chicago","temp":64,"datestamp":1643856000},{"location":"New York","temp":80,"datestamp":1643870400},{"location":"Los Angeles","temp":84,"datestamp":1643870400},{"location":"Chicago","temp":68,"datestamp":1643870400},{"location":"New York","temp":83,"datestamp":1643884800},{"location":"Los Angeles","temp":86,"datestamp":1643884800},{"location":"Chicago","temp":72,"datestamp":1643884800},{"location":"New York","temp":86,"datestamp":1643899200},{"location":"Los Angeles","temp":88,"datestamp":1643899200},{"location":"Chicago","temp":76,"datestamp":1643899200},{"location":"New York","temp":89,"datestamp":1643913600},{"location":"Los Angeles","temp":89,"datestamp":1643913600},{"location":"Chicago","temp":80,"datestamp":1643913600},{"location":"New York","temp":89,"datestamp":1643928000},{"location":"Los Angeles","temp":88,"datestamp":1643928000},{"location":"Chicago","temp":84,"datestamp":1643928000},{"location":"New York","temp":86,"datestamp":1643942400},{"location":"Los Angeles","temp":86,"datestamp":1643942400},{"location":"Chicago","temp":88,"datestamp":1643942400},{"location":"New York","temp":83,"datestamp":1643956800},{"location":"Los Angeles","temp":84,"datestamp":1643956800},{"location":"Chicago","temp":92,"datestamp":1643956800},{"location":"New York","temp":79,"datestamp":1643971200},{"location":"Los Angeles","temp":82,"datestamp":1643971200},{"location":"Chicago","temp":96,"datestamp":1643971200},{"location":"New York","temp":73,"datestamp":1643985600},{"location":"Los Angeles","temp":80,"datestamp":1643985600},{"location":"Chicago","temp":100,"datestamp":1643985600},{"location":"New York","temp":66,"datestamp":1644000000},{"location":"Los Angeles","temp":78,"datestamp":1644000000},{"location":"Chicago","temp":96,"datestamp":1644000000},{"location":"New York","temp":59,"datestamp":1644014400},{"location":"Los Angeles","temp":76,"datestamp":1644014400},{"location":"Chicago","temp":92,"datestamp":1644014400},{"location":"New York","temp":53,"datestamp":1644028800},{"location":"Los Angeles","temp":74,"datestamp":1644028800},{"location":"Chicago","temp":88,"datestamp":1644028800},{"location":"New York","temp":47,"datestamp":1644043200},{"location":"Los Angeles","temp":72,"datestamp":1644043200},{"location":"Chicago","temp":84,"datestamp":1644043200},{"location":"New York","temp":42,"datestamp":1644057600},{"location":"Los Angeles","temp":70,"datestamp":1644057600},{"location":"Chicago","temp":80,"datestamp":1644057600},{"location":"New York","temp":39,"datestamp":1644072000},{"location":"Los Angeles","temp":68,"datestamp":1644072000},{"location":"Chicago","temp":76,"datestamp":1644072000},{"location":"New York","temp":37,"datestamp":1644086400},{"location":"Los Angeles","temp":66,"datestamp":1644086400},{"location":"Chicago","temp":72,"datestamp":1644086400},{"location":"New York","temp":36,"datestamp":1644100800},{"location":"Los Angeles","temp":64,"datestamp":1644100800},{"location":"Chicago","temp":68,"datestamp":1644100800},{"location":"New York","temp":37,"datestamp":1644115200},{"location":"Los Angeles","temp":62,"datestamp":1644115200},{"location":"Chicago","temp":64,"datestamp":1644115200}]
const data = [{"location":"New York","temp":56,"datestamp":1643784000000},{"location":"Los Angeles","temp":67,"datestamp":1643784000000},{"location":"Chicago","temp":44,"datestamp":1643784000000},{"location":"New York","temp":60,"datestamp":1643798400000},{"location":"Los Angeles","temp":71,"datestamp":1643798400000},{"location":"Chicago","temp":48,"datestamp":1643798400000},{"location":"New York","temp":65,"datestamp":1643812800000},{"location":"Los Angeles","temp":74,"datestamp":1643812800000},{"location":"Chicago","temp":52,"datestamp":1643812800000},{"location":"New York","temp":69,"datestamp":1643827200000},{"location":"Los Angeles","temp":77,"datestamp":1643827200000},{"location":"Chicago","temp":56,"datestamp":1643827200000},{"location":"New York","temp":73,"datestamp":1643841600000},{"location":"Los Angeles","temp":80,"datestamp":1643841600000},{"location":"Chicago","temp":60,"datestamp":1643841600000},{"location":"New York","temp":77,"datestamp":1643856000000},{"location":"Los Angeles","temp":82,"datestamp":1643856000000},{"location":"Chicago","temp":64,"datestamp":1643856000000},{"location":"New York","temp":80,"datestamp":1643870400000},{"location":"Los Angeles","temp":84,"datestamp":1643870400000},{"location":"Chicago","temp":68,"datestamp":1643870400},{"location":"New York","temp":83,"datestamp":1643884800000},{"location":"Los Angeles","temp":86,"datestamp":1643884800000},{"location":"Chicago","temp":72,"datestamp":1643884800000},{"location":"New York","temp":86,"datestamp":1643899200000},{"location":"Los Angeles","temp":88,"datestamp":1643899200000},{"location":"Chicago","temp":76,"datestamp":1643899200000},{"location":"New York","temp":89,"datestamp":16439136000000},{"location":"Los Angeles","temp":89,"datestamp":1643913600000},{"location":"Chicago","temp":80,"datestamp":1643913600000},{"location":"New York","temp":89,"datestamp":1643928000000},{"location":"Los Angeles","temp":88,"datestamp":1643928000000},{"location":"Chicago","temp":84,"datestamp":1643928000000},{"location":"New York","temp":86,"datestamp":1643942400000},{"location":"Los Angeles","temp":86,"datestamp":1643942400000},{"location":"Chicago","temp":88,"datestamp":1643942400000},{"location":"New York","temp":83,"datestamp":1643956800000},{"location":"Los Angeles","temp":84,"datestamp":1643956800000},{"location":"Chicago","temp":92,"datestamp":1643956800000},{"location":"New York","temp":79,"datestamp":1643971200000},{"location":"Los Angeles","temp":82,"datestamp":1643971200000},{"location":"Chicago","temp":96,"datestamp":1643971200000},{"location":"New York","temp":73,"datestamp":1643985600000},{"location":"Los Angeles","temp":80,"datestamp":1643985600000},{"location":"Chicago","temp":100,"datestamp":1643985600000},{"location":"New York","temp":66,"datestamp":1644000000000000},{"location":"Los Angeles","temp":78,"datestamp":1644000000000},{"location":"Chicago","temp":96,"datestamp":1644000000000},{"location":"New York","temp":59,"datestamp":1644014400000},{"location":"Los Angeles","temp":76,"datestamp":1644014400000},{"location":"Chicago","temp":92,"datestamp":1644014400000},{"location":"New York","temp":53,"datestamp":1644028800000},{"location":"Los Angeles","temp":74,"datestamp":1644028800000},{"location":"Chicago","temp":88,"datestamp":1644028800000},{"location":"New York","temp":47,"datestamp":1644043200000},{"location":"Los Angeles","temp":72,"datestamp":1644043200000},{"location":"Chicago","temp":84,"datestamp":1644043200000},{"location":"New York","temp":42,"datestamp":1644057600000},{"location":"Los Angeles","temp":70,"datestamp":1644057600000},{"location":"Chicago","temp":80,"datestamp":1644057600000},{"location":"New York","temp":39,"datestamp":1644072000000},{"location":"Los Angeles","temp":68,"datestamp":1644072000000},{"location":"Chicago","temp":76,"datestamp":1644072000000},{"location":"New York","temp":37,"datestamp":1644086400000},{"location":"Los Angeles","temp":66,"datestamp":1644086400000},{"location":"Chicago","temp":72,"datestamp":1644086400000},{"location":"New York","temp":36,"datestamp":1644100800000},{"location":"Los Angeles","temp":64,"datestamp":1644100800000},{"location":"Chicago","temp":68,"datestamp":1644100800000},{"location":"New York","temp":37,"datestamp":1644115200000},{"location":"Los Angeles","temp":62,"datestamp":1644115200000},{"location":"Chicago","temp":64,"datestamp":1644115200000}]
const locNY = data.filter((d) => d.location === 'New York')
const locLA = data.filter((d) => d.location === 'Los Angeles')
const locCH = data.filter((d) => d.location === 'Chicago')
Expand Down

0 comments on commit c1c5a12

Please sign in to comment.