File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
special-pages/pages/new-tab/app/protections/mocks Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ export function protectionsMockTransport() {
8080 const msg = /** @type {any } */ ( _msg ) ;
8181 switch ( msg . method ) {
8282 case 'protections_getData' :
83+ // No data. Setting `stats=none` (totalCount = 0) also
84+ // hides CPM stats
8385 if ( url . searchParams . get ( 'stats' ) === 'none' ) {
8486 dataset . totalCount = 0 ;
8587 }
@@ -89,6 +91,14 @@ export function protectionsMockTransport() {
8991 if ( url . searchParams . get ( 'cpm' ) === 'true' ) {
9092 dataset . totalCookiePopUpsBlocked = 22 ;
9193 }
94+ // CPM = 0 state
95+ if ( url . searchParams . get ( 'cpm' ) === 'none' ) {
96+ dataset . totalCookiePopUpsBlocked = 0 ;
97+ }
98+ // CPM disabled state
99+ if ( url . searchParams . get ( 'cpm' ) === 'null' ) {
100+ dataset . totalCookiePopUpsBlocked = null ;
101+ }
92102 // Setting cpm=undefined allows us to see the legacy
93103 // protections report. Useful until all platforms adopt the
94104 // new schema
You can’t perform that action at this time.
0 commit comments