suite: ServiceMonitor template (monitoring disabled)
release:
  name: gitea-unittests
  namespace: testing
templates:
  - templates/gitea/servicemonitor.yaml
tests:
  - it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token empty
    set:
      gitea.metrics.enabled: false
      gitea.metrics.token: ""
      gitea.metrics.serviceMonitor.enabled: false
    asserts:
      - hasDocuments:
          count: 0
  - it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token not empty
    set:
      gitea.metrics.enabled: false
      gitea.metrics.token: "test-token"
      gitea.metrics.serviceMonitor.enabled: false
    asserts:
      - hasDocuments:
          count: 0
