Skip to content

Commit bee477f

Browse files
test: add unit tests for public project validation
1 parent 0ddc902 commit bee477f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

internal/cmd/affinity-groups/create/create_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,26 @@ func TestParseInput(t *testing.T) {
121121
},
122122
),
123123
},
124+
{
125+
description: "fails public project without network area and without billing reference",
126+
flagValues: fixtureFlagValues(
127+
func(flagValues map[string]string) {
128+
flagValues["label"] = "scope=PUBLIC"
129+
delete(flagValues, "network-area-id")
130+
},
131+
),
132+
isValid: false,
133+
},
134+
{
135+
description: "fails public project with empty billing reference",
136+
flagValues: fixtureFlagValues(
137+
func(flagValues map[string]string) {
138+
flagValues["label"] = "scope=PUBLIC,billingReference="
139+
delete(flagValues, "network-area-id")
140+
},
141+
),
142+
isValid: false,
143+
},
124144
}
125145
for _, tt := range tests {
126146
t.Run(tt.description, func(t *testing.T) {

0 commit comments

Comments
 (0)