From ebe85eaeb5b3934203b1369b6288ce2aedae4646 Mon Sep 17 00:00:00 2001 From: AleksandrMatsko Date: Fri, 1 Nov 2024 16:27:29 +0700 Subject: [PATCH] test: in package handler --- api/handler/triggers_test.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/api/handler/triggers_test.go b/api/handler/triggers_test.go index 1653cc73e..275121c15 100644 --- a/api/handler/triggers_test.go +++ b/api/handler/triggers_test.go @@ -109,15 +109,8 @@ func TestGetTriggerFromRequest(t *testing.T) { request = request.WithContext(middleware.SetContextValueForTest(request.Context(), "metricSourceProvider", sourceProvider)) request = request.WithContext(middleware.SetContextValueForTest(request.Context(), "limits", api.GetTestLimitsConfig())) - triggerDTO.Schedule = moira.NewDefaultScheduleData() - triggerDTO.Schedule.TimezoneOffset = 0 - triggerDTO.Schedule.StartOffset = 0 - triggerDTO.Schedule.EndOffset = 0 - for i := range triggerDTO.Schedule.Days { - if i != 0 { - triggerDTO.Schedule.Days[i].Enabled = false - } - } + triggerDTO.Schedule.Days = moira.GetFilledScheduleDataDays(false) + triggerDTO.Schedule.Days[0].Enabled = true Convey("It should be parsed successfully", func() { triggerDTO.TTL = moira.DefaultTTL