Skip to content

Commit

Permalink
test: add tests for invalid schedule and duration
Browse files Browse the repository at this point in the history
Signed-off-by: daengdaengLee <gunho1020@gmail.com>
  • Loading branch information
daengdaengLee committed Sep 22, 2024
1 parent 3f1248f commit ef3619c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/apis/application/v1alpha1/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2085,6 +2085,22 @@ func TestSyncWindows_InactiveAllows(t *testing.T) {
matchingIndex: 0,
expectedLength: 1,
},
{
name: "MatchNone-InvalidSchedule",
syncWindow: SyncWindows{
syncWindow("allow", "* 10 * * 7", "2h", ""),
},
currentTime: timeWithHour(17, time.UTC),
expectedLength: 0,
},
{
name: "MatchNone-InvalidDuration",
syncWindow: SyncWindows{
syncWindow("allow", "* 10 * * *", "2a", ""),
},
currentTime: timeWithHour(17, time.UTC),
expectedLength: 0,
},
}

for _, tt := range tests {
Expand Down

0 comments on commit ef3619c

Please sign in to comment.