require "test_helper" class ApplicationHelperTest < ActionView::TestCase test "priority badge includes dark theme colors" do html = priority_badge("high") assert_includes html, "bg-amber-100" assert_includes html, "dark:bg-amber-950" assert_includes html, "dark:text-amber-200" end test "stage badge includes dark theme colors" do html = stage_badge("interested") assert_includes html, "dark:bg-amber-950" assert_includes html, "dark:text-amber-200" end test "status badge includes dark theme colors" do html = status_badge("prospect") assert_includes html, "dark:bg-sky-950" assert_includes html, "dark:text-sky-200" end test "table clip keeps a title with the full value" do html = table_clip("Società affiliata FIPAV con un testo molto lungo da accorciare", length: 20) assert_includes html, "title=\"Società affiliata FIPAV con un testo molto lungo da accorciare\"" assert_includes html, "…" end test "queued SMTP retries are not shown as delivery failures" do recipient = MailingRecipient.new(status: "queued", error_message: "Da ritentare (1/8): end of file reached") html = mailing_recipient_delivery_note(recipient) assert_includes html, "Non risulta inviata" assert_not_includes html, "end of file reached" end test "failed recipients still show the SMTP error" do recipient = MailingRecipient.new(status: "failed", error_message: "end of file reached") html = mailing_recipient_delivery_note(recipient) assert_includes html, "end of file reached" end end