func waitForNoApproveOrDeny(ctx context.Context, cl client.Client, ns, name string) {
	Consistently(func() bool {
		cr := new(cmapi.CertificateRequest)
		Eventually(func() error {
			return cl.Get(ctx, client.ObjectKey{Namespace: ns, Name: name}, cr)
		}).Should(BeNil())
		return apiutil.CertificateRequestIsApproved(cr) || apiutil.CertificateRequestIsDenied(cr)
	}, "3s").Should(BeFalse(), "expected neither approved not denied")
}
waitForNoApproveOrDeny will wait a reasonable amount of time (3 seconds) for
the CertificateRequest to be marked as neither Approved or Denied.
package test
import (
	"context"
	"crypto/x509"
	apiutil "github.com/jetstack/cert-manager/pkg/api/util"
	cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	corev1 "k8s.io/api/core/v1"
	rbacv1 "k8s.io/api/rbac/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/klog/v2/klogr"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/client"
	policyapi "github.com/cert-manager/approver-policy/pkg/apis/policy/v1alpha1"
	"github.com/cert-manager/approver-policy/pkg/internal/controllers"
	"github.com/cert-manager/approver-policy/pkg/registry"
	"github.com/jetstack/cert-manager/test/unit/gen"
)
func waitForApproval(ctx context.Context, cl client.Client, ns, name string) {
	Eventually(func() bool {
		cr := new(cmapi.CertificateRequest)
		Eventually(func() error {
			return cl.Get(ctx, client.ObjectKey{Namespace: ns, Name: name}, cr)
		}).Should(BeNil())
		return apiutil.CertificateRequestIsApproved(cr)
	}).Should(BeTrue(), "expected approval")
}
func waitForDenial(ctx context.Context, cl client.Client, ns, name string) {
	Eventually(func() bool {
		cr := new(cmapi.CertificateRequest)
		Eventually(func() error {
			return cl.Get(ctx, client.ObjectKey{Namespace: ns, Name: name}, cr)
		}).Should(BeNil())
		return apiutil.CertificateRequestIsDenied(cr)
	}).Should(BeTrue(), "expected denial")
}