suite: ServiceMonitor
templates:
  - service-monitor.yaml

tests:
  - it: should not create service monitor by default
    asserts:
      - hasDocuments:
          count: 0

  - it: check defaults
    release:
      name: my-release
      namespace: my-namespace
    set:
      controlPlane:
        serviceMonitor:
          enabled: true
    asserts:
      - hasDocuments:
          count: 1
      - equal:
          path: metadata.name
          value: vc-my-release
      - equal:
          path: metadata.namespace
          value: my-namespace
      - equal:
          path: spec.selector.matchLabels.app
          value: vcluster
      - lengthEqual:
          path: spec.endpoints
          count: 1
