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:
@@ -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"])
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user