diff --git a/ui/src/ui/views/cron.test.ts b/ui/src/ui/views/cron.test.ts index aa09126dbf2..14592f76b4e 100644 --- a/ui/src/ui/views/cron.test.ts +++ b/ui/src/ui/views/cron.test.ts @@ -312,10 +312,17 @@ describe("cron view", () => { container, ); - const options = Array.from(container.querySelectorAll("option")).map((opt) => - (opt.textContent ?? "").trim(), - ); - expect(options).toContain("Webhook POST"); + const deliveryMode = container.querySelector("#cron-delivery-mode"); + expect(Array.from(deliveryMode?.options ?? []).map((opt) => opt.value)).toEqual([ + "announce", + "webhook", + "none", + ]); + expect(Array.from(deliveryMode?.options ?? []).map((opt) => opt.textContent?.trim())).toEqual([ + "Announce summary (default)", + "Webhook POST", + "None (internal)", + ]); render( renderCron( @@ -331,12 +338,16 @@ describe("cron view", () => { container, ); - const normalizedOptions = Array.from(container.querySelectorAll("option")).map((opt) => - (opt.textContent ?? "").trim(), - ); - expect(normalizedOptions).not.toContain("Announce summary (default)"); - expect(normalizedOptions).toContain("Webhook POST"); - expect(normalizedOptions).toContain("None (internal)"); + const normalizedDeliveryMode = + container.querySelector("#cron-delivery-mode"); + expect(normalizedDeliveryMode?.value).toBe("none"); + expect(Array.from(normalizedDeliveryMode?.options ?? []).map((opt) => opt.value)).toEqual([ + "webhook", + "none", + ]); + expect( + Array.from(normalizedDeliveryMode?.options ?? []).map((opt) => opt.textContent?.trim()), + ).toEqual(["Webhook POST", "None (internal)"]); expect(container.querySelector('input[placeholder="https://example.com/cron"]')).toBeNull(); });