Skip to content

Commit 1639031

Browse files
committed
Add test for hidden variable with default value not required
1 parent 5a67a5d commit 1639031

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

internal/orchestrator/app/validator_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ func TestValidateAppDescriptorBricks(t *testing.T) {
4141
Name: "I_AM_HIDDEN_WITHOUT_DEFAULT",
4242
Hidden: true,
4343
},
44+
{
45+
Name: "I_AM_HIDDEN_WITH_DEFAULT",
46+
Hidden: true,
47+
DefaultValue: "default-value",
48+
},
4449
},
4550
},
4651
},
@@ -156,6 +161,17 @@ bricks:
156161
`,
157162
expectedError: errors.New("variable \"I_AM_HIDDEN_WITHOUT_DEFAULT\" is required by brick \"arduino:brick-with-hidden-variable\""),
158163
},
164+
{
165+
name: "an hiddden variable with default value is not required",
166+
yamlContent: `
167+
name: App with
168+
bricks:
169+
- arduino:brick-with-hidden-variable:
170+
variables:
171+
I_AM_HIDDEN_WITHOUT_DEFAULT: "some-value"
172+
`,
173+
expectedError: nil,
174+
},
159175
}
160176

161177
for _, tc := range testCases {

0 commit comments

Comments
 (0)