# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: test scrapeConfigSelector
templates:
  - prometheus/prometheus.yaml
tests:
  - it: should automount ServiceAccountToken by default
    asserts:
      - equal:
          path: spec.automountServiceAccountToken
          value: true
  - it: should allow disabling automount ServiceAccountToken
    set:
      prometheus:
        prometheusSpec:
          automountServiceAccountToken: false
    asserts:
      - equal:
          path: spec.automountServiceAccountToken
          value: false
  - it: should be ignored, if set to null
    set:
      prometheus:
        prometheusSpec:
          automountServiceAccountToken: null
    asserts:
      - notExists:
          path: spec.automountServiceAccountToken
