-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@guardian/libs': minor | ||
--- | ||
|
||
Stop showing CMP on info pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
libs/@guardian/libs/src/consent-management-platform/exclusionList.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { isExcludedFromCMP } from './exclusionList.ts'; | ||
|
||
describe('isExcludedFromCMP', () => { | ||
test('should return false if empty', () => { | ||
expect(isExcludedFromCMP('')).toBe(false); | ||
}); | ||
|
||
test('should return false if param not in sectionExclusionList', () => { | ||
expect(isExcludedFromCMP('foo')).toBe(false); | ||
}); | ||
|
||
test('should return true if param in sectionExclusionList', () => { | ||
expect(isExcludedFromCMP('info')).toBe(true); | ||
}); | ||
}); |
6 changes: 6 additions & 0 deletions
6
libs/@guardian/libs/src/consent-management-platform/exclusionList.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const sectionExclusionList = ['info', 'help']; | ||
|
||
export const isExcludedFromCMP = (pageSection: string): boolean => { | ||
console.log('pageSection', pageSection); | ||
return sectionExclusionList.some((section) => section === pageSection); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters