-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButtonGroup.example.yaml
More file actions
192 lines (192 loc) · 5.8 KB
/
ButtonGroup.example.yaml
File metadata and controls
192 lines (192 loc) · 5.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Empty items array
# Target: simulate a ButtonGroup without any referenced widgets.
# Expected behavior: no elements are shown, confirming that an empty configuration
# results in a neutral layout (no placeholder or visual artifact).
kind: ButtonGroup
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-buttongroup-empty
namespace: krateo-system
spec:
widgetData:
allowedResources: [buttons]
alignment: left
gap: small
items: []
resourcesRefs:
items: []
---
# Missing resource reference
# Target: test the resilience of the layout when one of the child references is invalid or unresolved.
# Expected behavior: only valid items are displayed; invalid or missing references are silently ignored,
# ensuring that the group remains aligned and stable.
kind: ButtonGroup
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-buttongroup-missing-ref
namespace: krateo-system
spec:
widgetData:
allowedResources: [buttons]
alignment: left
gap: medium
items:
- resourceRefId: example-buttongroup-button-1
- resourceRefId: button-missing
resourcesRefs:
items:
- id: example-buttongroup-button-1
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-buttongroup-button-1
namespace: krateo-system
resource: buttons
verb:
---
kind: Button
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-buttongroup-button-1
namespace: krateo-system
spec:
widgetData:
actions: {}
label: Action
icon: fa-sun
type: primary
clickActionId: action-1
resourcesRefs:
items: []
---
# Single item alignment check
# Target: validate layout behavior when only one child is present.
# Expected behavior: the single widget remains aligned according to the specified rule
# (in this case, centered within the inline container).
kind: ButtonGroup
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-buttongroup-single-center
namespace: krateo-system
spec:
widgetData:
allowedResources: [buttons]
alignment: center
gap: small
items:
- resourceRefId: example-buttongroup-button-1
resourcesRefs:
items:
- id: example-buttongroup-button-1
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-buttongroup-button-1
namespace: krateo-system
resource: buttons
verb: GET
---
# Multiple items with default spacing
# Target: verify that multiple widgets are rendered in a single horizontal row with consistent small spacing.
# Expected behavior: items appear inline, aligned to the left, evenly separated using the default gap value.
kind: ButtonGroup
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-buttongroup-multiple-default
namespace: krateo-system
spec:
widgetData:
allowedResources: [buttons]
alignment: left
gap: small
items:
- resourceRefId: example-buttongroup-button-1
- resourceRefId: example-buttongroup-button-2
resourcesRefs:
items:
- id: example-buttongroup-button-1
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-buttongroup-button-1
namespace: krateo-system
resource: buttons
verb: GET
- id: example-buttongroup-button-2
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-buttongroup-button-2
namespace: krateo-system
resource: buttons
verb: GET
---
kind: Button
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-buttongroup-button-2
namespace: krateo-system
spec:
widgetData:
actions: {}
label: Other action
icon: fa-sun
type: default
clickActionId: action-1
resourcesRefs:
items: []
---
# Large gap configuration
# Target: verify that wider spacing between elements is applied when a large gap is configured.
# Expected behavior: items are rendered inline with noticeable separation, maintaining readability
# and visual clarity even with multiple elements.
kind: ButtonGroup
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-buttongroup-large-gap
namespace: krateo-system
spec:
widgetData:
allowedResources: [buttons]
alignment: left
gap: large
items:
- resourceRefId: example-buttongroup-button-1
- resourceRefId: example-buttongroup-button-2
resourcesRefs:
items:
- id: example-buttongroup-button-1
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-buttongroup-button-1
namespace: krateo-system
resource: buttons
verb: GET
- id: example-buttongroup-button-2
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-buttongroup-button-2
namespace: krateo-system
resource: buttons
verb: GET
---
# Alignment to the right
# Target: ensure correct horizontal alignment when elements should appear right-justified.
# Expected behavior: all widgets are grouped together along the right margin, preserving their spacing and order.
kind: ButtonGroup
apiVersion: widgets.templates.krateo.io/v1beta1
metadata:
name: example-buttongroup-right-aligned
namespace: krateo-system
spec:
widgetData:
allowedResources: [buttons]
alignment: right
gap: medium
items:
- resourceRefId: example-buttongroup-button-1
- resourceRefId: example-buttongroup-button-2
resourcesRefs:
items:
- id: example-buttongroup-button-1
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-buttongroup-button-1
namespace: krateo-system
resource: buttons
verb: GET
- id: example-buttongroup-button-2
apiVersion: widgets.templates.krateo.io/v1beta1
name: example-buttongroup-button-2
namespace: krateo-system
resource: buttons
verb: GET