Skip to content

Commit 2dca121

Browse files
authored
Merge pull request #13822 from guardian/doml/europe-test-remove-ad-1-mobile
Remove top ad on mobile beta fronts
2 parents 7633d60 + bd1fabb commit 2dca121

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

dotcom-rendering/src/lib/getFrontsAdPositions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ describe('Mobile Ads', () => {
218218

219219
it('Europe Network Front, with beta containers and more than 4 collections, with thrashers in various places', () => {
220220
const testCollections: AdCandidateMobile[] = [
221-
{ collectionType: 'flexible/general', containerLevel: 'Primary' }, // Ad position (0)
221+
{ collectionType: 'flexible/general', containerLevel: 'Primary' }, // Ignored - is before secondary container
222222
{ collectionType: 'scrollable/small', containerLevel: 'Secondary' }, // Ignored - is before secondary container
223223
{ collectionType: 'scrollable/small', containerLevel: 'Secondary' }, // Ignored - is before secondary container
224224
{
@@ -262,7 +262,7 @@ describe('Mobile Ads', () => {
262262

263263
const mobileAdPositions = getMobileAdPositions(testCollections);
264264

265-
expect(mobileAdPositions).toEqual([0, 4, 6, 8, 13, 18]);
265+
expect(mobileAdPositions).toEqual([4, 6, 8, 13, 18]);
266266
});
267267
});
268268

dotcom-rendering/src/lib/getFrontsAdPositions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,8 @@ const canInsertMobileAd =
109109

110110
/** Additional rules exist for "beta" fronts which have primary and secondary level containers */
111111
const betaFrontRules = [
112-
// Allow insertion after first container at any time but for all other situations,
113-
// prevent insertion before a secondary level container
114-
index === 0 || !isBeforeSecondaryLevelContainer(index, collections),
112+
// Prevent insertion before a secondary level container
113+
!isBeforeSecondaryLevelContainer(index, collections),
115114
// Prevent insertion before a branded container
116115
!isBeforeBrandedContainer(index, collections),
117116
];

0 commit comments

Comments
 (0)