Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: update cookies categories (#1616)
Browse files Browse the repository at this point in the history
* fix: update cookies categories

* Merge branch 'development' into update-cookies-categories

* Merge branch 'development' into update-cookies-categories

* Merge branch 'development' into update-cookies-categories
  • Loading branch information
razvan-pro authored Feb 14, 2022
1 parent 56e6af0 commit fa159e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions game_frontend/src/redux/features/Analytics/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function hasAnalyticsCookiesConsent() {
// C0002 is the Analytics Cookies category in OneTrust
return !!window.OnetrustActiveGroups && window.OnetrustActiveGroups.split(',').includes('C0002')
// CL002 is the Analytics Cookies category in OneTrust
return !!window.OnetrustActiveGroups && window.OnetrustActiveGroups.split(',').includes('CL002')
}

export { hasAnalyticsCookiesConsent }
Expand Down
4 changes: 2 additions & 2 deletions game_frontend/src/redux/features/Analytics/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { hasAnalyticsCookiesConsent } from './index'

describe('hasAnalyticsCookiesConsent', () => {
it('returns true when OnetrustActiveGroups contains analytics cookies consent', () => {
window.OnetrustActiveGroups = 'C0001,C0002'
window.OnetrustActiveGroups = 'CL001,CL002'
expect(hasAnalyticsCookiesConsent()).toBe(true)
})

it('returns false when OnetrustActiveGroups is not set or does not contain analytics cookies consent', () => {
window.OnetrustActiveGroups = undefined
expect(hasAnalyticsCookiesConsent()).toBe(false)

window.OnetrustActiveGroups = 'C0001,C0003'
window.OnetrustActiveGroups = 'CL001,CL003'
expect(hasAnalyticsCookiesConsent()).toBe(false)
})
})

0 comments on commit fa159e2

Please sign in to comment.