Skip to content

Commit dc8ca9f

Browse files
committed
Update validator_test.go
1 parent fa54e74 commit dc8ca9f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

internal/orchestrator/app/validator_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,22 @@ func TestValidateAppDescriptorBricks(t *testing.T) {
3333
},
3434
},
3535
},
36+
{
37+
ID: "arduino:brick-with-hidden-variable",
38+
Name: "Hidden variable brick",
39+
Variables: []bricksindex.BrickVariable{
40+
{
41+
Name: "I_AM_HIDDEN",
42+
Description: "I am an hidden variable",
43+
Hidden: true,
44+
},
45+
{
46+
Name: "I_AM_HIDDEN_AND_REQUIRED",
47+
Description: "I am an hidden and required variable",
48+
DefaultValue: "", // Required (no default value)
49+
},
50+
},
51+
},
3652
},
3753
}
3854

@@ -134,6 +150,15 @@ bricks:
134150
NOT_EXISTING_VARIABLE: "this-is-a-not-existing-variable-for-the-brick"
135151
ARDUINO_DEVICE_ID: "my-device-id"
136152
ARDUINO_SECRET: "my-secret"
153+
`,
154+
expectedError: nil,
155+
},
156+
{
157+
name: "hidden variables are not required to be set",
158+
yamlContent: `
159+
name: App with
160+
bricks:
161+
- arduino:brick-with-hidden-variable:
137162
`,
138163
expectedError: nil,
139164
},

0 commit comments

Comments
 (0)