From 7c02512a228541a416b28c69ac2ebb7b9c2d4799 Mon Sep 17 00:00:00 2001 From: Tommy Bidne Date: Mon, 20 Jan 2025 16:07:30 +1300 Subject: [PATCH] Add date filtering functional test --- .../data/testFilterPreds/chart-requests.toml | 5 ++ .../functional/goldens/testFilterPreds.golden | 90 +++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/test/functional/data/testFilterPreds/chart-requests.toml b/test/functional/data/testFilterPreds/chart-requests.toml index 552ed83..a5b201c 100644 --- a/test/functional/data/testFilterPreds/chart-requests.toml +++ b/test/functional/data/testFilterPreds/chart-requests.toml @@ -22,3 +22,8 @@ filters = ['duration > 40m', 'duration < 3h'] title = 'Specific duration runs using and' y-axis = 'duration' filters = ['and (duration > 40m) (duration < 3h)'] + +[[charts]] +title = 'Runs within date range' +y-axis = 'distance' +filters = ['and (date >= 2024-10-17) (date < 2024-10-19)'] diff --git a/test/functional/goldens/testFilterPreds.golden b/test/functional/goldens/testFilterPreds.golden index 3aea2f8..fc621ee 100644 --- a/test/functional/goldens/testFilterPreds.golden +++ b/test/functional/goldens/testFilterPreds.golden @@ -446,6 +446,96 @@ } } } + }, + { + "datasets": { + "xAxis": [ + "2024-10-17", + "2024-10-18" + ], + "yAxes": [ + { + "data": [ + 10, + 30 + ], + "fill": false, + "label": "distance", + "pointHoverRadius": 20, + "tension": 0, + "yAxisID": "y" + } + ] + }, + "extra": {}, + "options": { + "maintainAspectRatio": false, + "plugins": { + "legend": { + "labels": { + "color": "#c3c3c3" + } + }, + "title": { + "align": "center", + "color": "#c3c3c3", + "display": true, + "font": { + "size": 24 + }, + "text": "Runs within date range" + }, + "tooltip": { + "backgroundColor": "rgba(204, 204, 204, 0.75)", + "bodyColor": "black", + "titleColor": "black" + } + }, + "pointHitRadius": 20, + "responsive": true, + "scales": { + "x": { + "grid": { + "color": "#393939" + }, + "ticks": { + "color": "#c3c3c3" + }, + "time": { + "displayFormats": { + "day": "dd MMM yy" + }, + "unit": "day" + }, + "title": { + "color": "#c3c3c3", + "display": true, + "font": { + "size": 16 + }, + "text": "datetime" + }, + "type": "timeseries" + }, + "y": { + "grid": { + "color": "#393939" + }, + "position": "left", + "ticks": { + "color": "#c3c3c3" + }, + "title": { + "color": "#c3c3c3", + "display": true, + "font": { + "size": 16 + }, + "text": "km" + } + } + } + } } ]