Skip to content
quarry Artifact [8f8cd465af]
Login

Artifact [8f8cd465af]

Artifact 8f8cd465af5cdfd4b8894bd0a9b49af2e32efa54843a904ef04ace0b64ae8f70:


package api

import (
	"slices"
	"testing"
)

// A test alert goes to the one person named, through the alert workflow,
// marked as a test, and is not remembered as a telling: a real alert
// right after it still goes out.
func TestATestAlertGoesToOnePersonAndIsNotRemembered(t *testing.T) {
	r := newAlertRig("ann", "bo")
	r.a.test("ann")
	got := r.sent()
	if !slices.Equal(got, []string{"quarry-ops-alert:ann:test"}) {
		t.Fatalf("FAIL: a test alert sent %v", got)
	}
	if len(r.prefs.m) != 0 {
		t.Errorf("FAIL: a test was remembered as a telling: %v", r.prefs.m)
	}
	if !t.Failed() {
		t.Log("ok")
	}
}