suite: Controller > PrometheusRule
templates:
  - controller-prometheusrule.yaml

tests:
  - it: should create a PrometheusRule if `controller.metrics.prometheusRule.enabled` is true
    set:
      controller.metrics.enabled: true
      controller.metrics.prometheusRule.enabled: true
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: PrometheusRule
      - equal:
          path: metadata.name
          value: RELEASE-NAME-ingress-nginx-controller

  - it: should create a PrometheusRule with annotations if `controller.metrics.prometheusRule.annotations` is set
    set:
      controller.metrics.enabled: true
      controller.metrics.prometheusRule.enabled: true
      controller.metrics.prometheusRule.annotations:
        my-little-annotation: test-value
    asserts:
      - equal:
          path: metadata.annotations
          value:
            my-little-annotation: test-value
