From daf8e3a16fa2a68000fc0416999e1e941f859f4d Mon Sep 17 00:00:00 2001 From: TwiN Date: Tue, 30 Aug 2022 20:00:04 -0400 Subject: [PATCH] test(chart): Improve coverage for response time charts --- controller/handler/badge_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/controller/handler/badge_test.go b/controller/handler/badge_test.go index cffd2eb1..459ea910 100644 --- a/controller/handler/badge_test.go +++ b/controller/handler/badge_test.go @@ -140,6 +140,16 @@ func TestBadge(t *testing.T) { Path: "/api/v1/endpoints/core_backend/response-times/24h/chart.svg", ExpectedCode: http.StatusOK, }, + { + Name: "chart-response-time-7d", + Path: "/api/v1/endpoints/core_frontend/response-times/7d/chart.svg", + ExpectedCode: http.StatusOK, + }, + { + Name: "chart-response-time-with-invalid-duration", + Path: "/api/v1/endpoints/core_backend/response-times/3d/chart.svg", + ExpectedCode: http.StatusBadRequest, + }, } for _, scenario := range scenarios { t.Run(scenario.Name, func(t *testing.T) {