fix: refactor tests
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / Test readiness for publishing provider (pull_request) Failing after 3m27s
CI Workflow / CI run tests (pull_request) Failing after 4m54s
CI Workflow / CI run build and linting (pull_request) Failing after 4m39s
CI Workflow / Code coverage report (pull_request) Has been skipped

This commit is contained in:
Marcel S. Henselin 2026-03-09 11:03:29 +01:00
parent 826bb5b36a
commit c7260e04e2
19 changed files with 521 additions and 938 deletions

View file

@ -169,11 +169,11 @@ func TestMapFieldsCreate(t *testing.T) {
UserId: types.Int64Value(1),
InstanceId: types.StringValue("iid"),
ProjectId: types.StringValue("pid"),
Name: types.StringNull(),
Name: types.StringValue(""),
Roles: types.List(types.SetNull(types.StringType)),
Password: types.StringNull(),
Region: types.StringValue(testRegion),
Status: types.StringNull(),
Status: types.StringValue(""),
//ConnectionString: types.StringNull(),
},
true,
@ -213,11 +213,11 @@ func TestMapFieldsCreate(t *testing.T) {
UserId: types.Int64Value(1),
InstanceId: types.StringValue("iid"),
ProjectId: types.StringValue("pid"),
Name: types.StringNull(),
Name: types.StringValue(""),
Roles: types.List(types.SetNull(types.StringType)),
Password: types.StringNull(),
Region: types.StringValue(testRegion),
Status: types.StringNull(),
Status: types.StringValue(""),
//ConnectionString: types.StringNull(),
},
true,
@ -260,7 +260,7 @@ func TestMapFieldsCreate(t *testing.T) {
t.Fatalf("Should not have failed: %v", err)
}
if tt.isValid {
diff := cmp.Diff(state, &tt.expected)
diff := cmp.Diff(&tt.expected, state)
if diff != "" {
t.Fatalf("Data does not match: %s", diff)
}
@ -290,10 +290,10 @@ func TestMapFields(t *testing.T) {
UserId: types.Int64Value(int64(1)),
InstanceId: types.StringValue("iid"),
ProjectId: types.StringValue("pid"),
Name: types.StringNull(),
Name: types.StringValue(""),
Roles: types.List(types.SetNull(types.StringType)),
Region: types.StringValue(testRegion),
Status: types.StringNull(),
Status: types.StringValue(""),
//ConnectionString: types.StringNull(),
},
true,
@ -326,7 +326,7 @@ func TestMapFields(t *testing.T) {
),
),
Region: types.StringValue(testRegion),
Status: types.StringNull(),
Status: types.StringValue(""),
//ConnectionString: types.StringNull(),
},
true,
@ -343,10 +343,10 @@ func TestMapFields(t *testing.T) {
UserId: types.Int64Value(1),
InstanceId: types.StringValue("iid"),
ProjectId: types.StringValue("pid"),
Name: types.StringNull(),
Name: types.StringValue(""),
Roles: types.List(types.SetNull(types.StringType)),
Region: types.StringValue(testRegion),
Status: types.StringNull(),
Status: types.StringValue(""),
//ConnectionString: types.StringNull(),
},
true,