diff --git a/appc/appconnector_test.go b/appc/appconnector_test.go index 4f1ffb15c..c43a9e835 100644 --- a/appc/appconnector_test.go +++ b/appc/appconnector_test.go @@ -524,6 +524,7 @@ func TestUpdateDomainRouteRemoval(t *testing.T) { ctx := t.Context() bus := eventbustest.NewBus(t) for _, shouldStore := range []bool{false, true} { + w := eventbustest.NewWatcher(t, bus) rc := &appctest.RouteCollector{} assertRoutes := func(prefix string, routes, removedRoutes []netip.Prefix) { @@ -575,6 +576,20 @@ func TestUpdateDomainRouteRemoval(t *testing.T) { wantRemovedRoutes = prefixes("1.2.3.3/32", "1.2.3.4/32") } assertRoutes("removal", wantRoutes, wantRemovedRoutes) + + wantEvents := []any{ + // Each DNS record observed triggers an update. + eqUpdate(RouteUpdate{Advertise: prefixes("1.2.3.1/32")}), + eqUpdate(RouteUpdate{Advertise: prefixes("1.2.3.2/32")}), + eqUpdate(RouteUpdate{Advertise: prefixes("1.2.3.3/32")}), + eqUpdate(RouteUpdate{Advertise: prefixes("1.2.3.4/32")}), + } + if shouldStore { + wantEvents = append(wantEvents, eqUpdate(RouteUpdate{Unadvertise: prefixes("1.2.3.3/32", "1.2.3.4/32")})) + } + if err := eventbustest.Expect(w, wantEvents...); err != nil { + t.Error(err) + } } }