FIX: Ensure graph url has integer duration

FIX: Ensure graph url has integer duration

diff --git a/assets/javascripts/discourse/widgets/alert-receiver.js.es6 b/assets/javascripts/discourse/widgets/alert-receiver.js.es6
index 2293320..6db0fb6 100644
--- a/assets/javascripts/discourse/widgets/alert-receiver.js.es6
+++ b/assets/javascripts/discourse/widgets/alert-receiver.js.es6
@@ -181,7 +181,7 @@ createWidget("alert-receiver-row", {
     const windowDuration = (end - start) / 1000 + 600; // Add 10 minutes
     const windowEndDate = new Date(end.getTime() + 300 * 1000); // Shift 5 minutes forward
 
-    url.searchParams.set("g0.range_input", `${windowDuration}s`);
+    url.searchParams.set("g0.range_input", `${Math.ceil(windowDuration)}s`);
     url.searchParams.set("g0.end_input", windowEndDate.toISOString());
     url.searchParams.set("g0.tab", "0");
 
diff --git a/test/javascripts/acceptance/alert-receiver-test.js.es6 b/test/javascripts/acceptance/alert-receiver-test.js.es6
index 3131d7f..3a712a7 100644
--- a/test/javascripts/acceptance/alert-receiver-test.js.es6
+++ b/test/javascripts/acceptance/alert-receiver-test.js.es6
@@ -72,7 +72,7 @@ QUnit.test("displays all the alerts", async assert => {
     find(
       ".prometheus-alert-receiver [data-alert-status='resolved'] table tr td:first-child a"
     ).attr("href"),
-    "https://metrics.sjc1.discourse.cloud/graph?g0.expr=mymetric&g0.tab=0&g0.range_input=1126.344s&g0.end_input=2020-07-27T17%3A40%3A35.870Z",
+    "https://metrics.sjc1.discourse.cloud/graph?g0.expr=mymetric&g0.tab=0&g0.range_input=1127s&g0.end_input=2020-07-27T17%3A40%3A35.870Z",
     "links each alert to its graph, with added timestamp"
   );
 

GitHub sha: c6c3c3a7