mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-03 15:19:16 -03:00
tests
This commit is contained in:
@@ -62,6 +62,11 @@ tests:
|
||||
custom:
|
||||
some-key: some-value
|
||||
some-other-key: some-other-value
|
||||
customkv:
|
||||
- key: some-key-slice
|
||||
value: some-value-slice
|
||||
- key: some-other-key-slice
|
||||
value: some-other-value-slice
|
||||
hosts: &hosts
|
||||
- host: test-host
|
||||
paths:
|
||||
@@ -106,6 +111,8 @@ tests:
|
||||
gethomepage.dev/pod-selector: pod.name in (main,other)
|
||||
gethomepage.dev/widget.some-key: some-value
|
||||
gethomepage.dev/widget.some-other-key: some-other-value
|
||||
gethomepage.dev/widget.some-key-slice: some-value-slice
|
||||
gethomepage.dev/widget.some-other-key-slice: some-other-value-slice
|
||||
- documentIndex: *otherIngressDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
@@ -154,3 +161,23 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Ingress - Expected [integrations.homepage.widget.custom] to be a [map], but got [string]
|
||||
|
||||
- it: should fail with customkv widget not a slice
|
||||
set:
|
||||
operator: *operator
|
||||
service: *service
|
||||
ingress:
|
||||
my-ingress1:
|
||||
enabled: true
|
||||
primary: true
|
||||
integrations:
|
||||
traefik:
|
||||
enabled: false
|
||||
homepage:
|
||||
enabled: true
|
||||
widget:
|
||||
customkv: "not a slice"
|
||||
hosts: *hosts
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Ingress - Expected [integrations.homepage.widget.customkv] to be a [slice], but got [string]
|
||||
|
||||
@@ -75,4 +75,10 @@
|
||||
{{- fail (printf "Ingress - Expected [integrations.homepage.widget.custom] to be a [map], but got [%s]" (kindOf $homepage.widget.custom)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $homepage.widget.customkv -}}
|
||||
{{- if not (kindIs "slice" $homepage.widget.customkv) -}}
|
||||
{{- fail (printf "Ingress - Expected [integrations.homepage.widget.customkv] to be a [slice], but got [%s]" (kindOf $homepage.widget.customkv)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user