Skip to content

Commit 484b5b1

Browse files
committed
test: update validation_test tests
1 parent 30ad47c commit 484b5b1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

provider/helpers/validation_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,14 @@ func TestValidateURL(t *testing.T) {
138138
warnings, errors := ValidateURL(tt.value, tt.label)
139139

140140
if tt.expectError {
141-
require.NotEmpty(t, errors, "expected an error but got none")
142-
143-
if tt.errorContains != "" {
144-
require.Contains(t, errors[0].Error(), tt.errorContains)
145-
}
141+
require.Len(t, errors, 1, "expected an error but got none")
142+
require.Contains(t, errors[0].Error(), tt.errorContains)
146143
} else {
147144
require.Empty(t, errors, "expected no errors but got: %v", errors)
148145
}
149146

150147
// Should always return nil for warnings
151-
require.Nil(t, warnings, "expected warnings to be nil, got %v", warnings)
148+
require.Nil(t, warnings, "expected warnings to be nil but got: %v", warnings)
152149
})
153150
}
154151
}

0 commit comments

Comments
 (0)