Background
We have the experiment prefix currently polluting the root element: wikimedia-donor-badge-.
We need to fix this.
In the event the badge has been turned on from a previous accidental early release, the minerva-badge-clientpref-1
class will be present on the HTML but the badge will not be shown as ext.wikimediaCustomizations.donorDelightBadge.styles
will not be present.
Goal
'ext.wikimediaCustomizations.donorDelightBadge.styles' and 'ext.wikimediaCustomizations.donorDelightBadge' modules are no longer added to the page, if the client is not in an assigned group of the experiment.
Engineering notes
For cached versions of the site the class wikimedia-donor-badge- will still be present on the HTML for 2 more weeks after next train.
Acceptance criteria for done
- Don't load 'ext.wikimediaCustomizations.donorDelightBadge.styles' and 'ext.wikimediaCustomizations.donorDelightBadge' modules when client is not in assigned group of experiment.
BDD
Feature: Donor badge modules excluded for unassigned clients
Scenario: Client not in an assigned experiment group
Given I am a logged-out user on mobile web (Minerva)
And I am not bucketed into any group of the donor-delight-badge experiment
When the page renders
Then the ext.wikimediaCustomizations.donorDelightBadge JS module is not loaded
And the ext.wikimediaCustomizations.donorDelightBadge.styles CSS module is not loaded
And no wikimedia-donor-badge-* / donor pollution class is present on <html>Test Plan
Test Case 1: Unassigned client does not load the badge modules
On beta (en.wikipedia.beta is NOT a targeted wiki), mobile/Minerva, logged out:
clear any TestKitchen override (mw.testKitchen.clearExperimentOverrides()), remove the donor cookie; reload.
AC1: mw.testKitchen.getAssignments() is empty (client is unassigned).
AC2: mw.loader.getState('ext.wikimediaCustomizations.donorDelightBadge') is NOT 'ready' (state 'registered' = declared but not loaded/executed); same for '.styles'.
AC3: <html> carries no wikimedia-donor-badge-* / donor pollution class.
Test Results
| AC | Status | Details for test run T427965#12008049 |
|---|---|---|
| 1 | ✅ | unassigned client: mw.testKitchen.getAssignments() === [] |
| 2 | ✅ | donorDelightBadge + .styles state 'registered' (NOT loaded) — see T427965_beta_AC1_1.png |
| 3 | ✅ | no donor class on <html> (hasDonorClass=false) |
