Fix opt-out button opening panel instead of rejecting

In OPT_OUT mode the button_opt_out text was mapped to
button_customize, which opens the preference panel. Map it
to button_reject_all instead so the button performs a
one-click reject for all OPT_OUT regulations.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-08 11:28:58 +04:00
parent 5a80073356
commit 16504814a8
2 changed files with 6 additions and 4 deletions

View File

@@ -308,13 +308,15 @@ func TestRemapTextsForConsentMode(t *testing.T) {
assert.Empty(t, texts["button_customize"])
})
t.Run("opt out mode clears reject", func(t *testing.T) {
t.Run("opt out mode maps opt out to reject and clears customize", func(t *testing.T) {
t.Parallel()
texts := baseTexts()
texts["button_opt_out"] = "Do Not Sell"
remapTextsForConsentMode(texts, ConsentModeOptOut, RegulationCCPA)
assert.Empty(t, texts["button_reject_all"])
assert.Equal(t, "Do Not Sell", texts["button_reject_all"])
assert.Empty(t, texts["button_customize"])
})
}