Skip to content

A platform for community discussion. Free, open, simple.

FIX: dashboard test depended on the last month has 31 days

Kyle Zhao4b517d460d72
diff --git a/test/javascripts/fixtures/reports_bulk.js.es6 b/test/javascripts/fixtures/reports_bulk.js.es6
index 708640766e2..5e303d6fc0e 100644
--- a/test/javascripts/fixtures/reports_bulk.js.es6
+++ b/test/javascripts/fixtures/reports_bulk.js.es6
@@ -97,6 +97,8 @@ const endDate = moment()
.utc()
.endOf("day");
+const daysInQueryPeriod = endDate.diff(startDate, "days", false) + 1;
+
const data = [
851,
3805,
@@ -130,7 +132,7 @@ const data = [
4048,
2523,
1062
-];
+].slice(-daysInQueryPeriod);
const page_view_total_reqs = {
type: "page_view_total_reqs",