Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vandyliu committed Apr 15, 2024
1 parent 9fb899e commit 37390e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions internal/provider/validators/is_cuid_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package validators_test

import (
"fmt"
"testing"

"github.com/astronomer/astronomer-terraform-provider/internal/provider/validators"
Expand All @@ -16,7 +17,7 @@ func TestUnit_Validators_IsCuid(t *testing.T) {
expectedIsCuid bool
}
testCases := []testCase{
{str: "null", expectedIsCuid: false},
{str: "null", expectedIsCuid: true},
{str: "unknown", expectedIsCuid: true},
{str: cuid.New(), expectedIsCuid: true},
{str: "abcdef", expectedIsCuid: false},
Expand All @@ -39,7 +40,7 @@ func TestUnit_Validators_IsCuid(t *testing.T) {
}
response := validator.StringResponse{}
isCuidValidator.ValidateString(nil, request, &response)
assert.Equal(t, response.Diagnostics.HasError(), !tc.expectedIsCuid)
assert.Equal(t, response.Diagnostics.HasError(), !tc.expectedIsCuid, fmt.Sprintf("test case: %s failed", tc.str))
})
}
}
2 changes: 1 addition & 1 deletion internal/utils/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestUnit_ObjectList(t *testing.T) {
assert.Contains(t, objString, v.Key.ValueString())
assert.Contains(t, objString, v.Value.ValueString())
assert.Contains(t, objString, v.UpdatedAt.ValueString())
assert.Contains(t, objString, v.IsSecret.ValueBool())
assert.Contains(t, objString, fmt.Sprintf("%v", v.IsSecret.ValueBool()))
}
})
}
Expand Down

0 comments on commit 37390e7

Please sign in to comment.