Skip to content

Commit

Permalink
Clean up consent mapping in test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexs-mparticle committed Feb 20, 2024
1 parent fb74ff0 commit b9aeaad
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions test/src/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,33 @@ describe('Adwords forwarder', function () {
});

describe('Consent State', function () {
var consentMap = [
{
jsmap: null,
map: 'some_consent',
maptype: 'ConsentPurposes',
value: 'ad_user_data',
},
{
jsmap: null,
map: 'storage_consent',
maptype: 'ConsentPurposes',
value: 'analytics_storage',
},
{
jsmap: null,
map: 'other_test_consent',
maptype: 'ConsentPurposes',
value: 'ad_storage',
},
{
jsmap: null,
map: 'test_consent',
maptype: 'ConsentPurposes',
value: 'ad_personalization',
},
];

beforeEach(function () {
window.dataLayer = [];
window.gtag = function () {
Expand Down Expand Up @@ -1173,8 +1200,7 @@ describe('Adwords forwarder', function () {
{
conversionId: 'AW-123123123',
enableGtag: 'True',
consentMappingWeb:
'[{"jsmap":null,"map":"some_consent","maptype":"ConsentPurposes","value":"ad_user_data"},{"jsmap":null,"map":"storage_consent","maptype":"ConsentPurposes","value":"analytics_storage"},{"jsmap":null,"map":"other_test_consent","maptype":"ConsentPurposes","value":"ad_storage"},{"jsmap":null,"map":"test_consent","maptype":"ConsentPurposes","value":"ad_personalization"}]',
consentMappingWeb: JSON.stringify(consentMap),
},
reportService.cb,
true
Expand All @@ -1201,8 +1227,7 @@ describe('Adwords forwarder', function () {
{
conversionId: 'AW-123123123',
enableGtag: 'True',
consentMappingWeb:
'[{"jsmap":null,"map":"some_consent","maptype":"ConsentPurposes","value":"ad_user_data"},{"jsmap":null,"map":"storage_consent","maptype":"ConsentPurposes","value":"analytics_storage"},{"jsmap":null,"map":"other_test_consent","maptype":"ConsentPurposes","value":"ad_storage"},{"jsmap":null,"map":"test_consent","maptype":"ConsentPurposes","value":"ad_personalization"}]',
consentMappingWeb: JSON.stringify(consentMap),
adPersonalizationConsentWeb: 'Granted', // Will be overriden by User Consent State
adUserDataConsentWeb: 'Granted', // Will be overriden by User Consent State
adStorageConsentWeb: 'Granted',
Expand Down Expand Up @@ -1236,8 +1261,7 @@ describe('Adwords forwarder', function () {
{
conversionId: 'AW-123123123',
enableGtag: 'True',
consentMappingWeb:
'[{"jsmap":null,"map":"some_consent","maptype":"ConsentPurposes","value":"ad_user_data"},{"jsmap":null,"map":"storage_consent","maptype":"ConsentPurposes","value":"analytics_storage"},{"jsmap":null,"map":"other_test_consent","maptype":"ConsentPurposes","value":"ad_storage"},{"jsmap":null,"map":"test_consent","maptype":"ConsentPurposes","value":"ad_personalization"}]',
consentMappingWeb: JSON.stringify(consentMap),
adStorageConsentWeb: 'Unspecified', // Will be overriden by User Consent State
adUserDataConsentWeb: 'Unspecified', // Will be overriden by User Consent State
adPersonalizationConsentWeb: 'Unspecified',
Expand Down Expand Up @@ -1269,8 +1293,7 @@ describe('Adwords forwarder', function () {
{
conversionId: 'AW-123123123',
enableGtag: 'True',
consentMappingWeb:
'[{"jsmap":null,"map":"some_consent","maptype":"ConsentPurposes","value":"ad_user_data"},{"jsmap":null,"map":"storage_consent","maptype":"ConsentPurposes","value":"analytics_storage"},{"jsmap":null,"map":"other_test_consent","maptype":"ConsentPurposes","value":"ad_storage"},{"jsmap":null,"map":"test_consent","maptype":"ConsentPurposes","value":"ad_personalization"}]',
consentMappingWeb: JSON.stringify(consentMap),
},
reportService.cb,
true
Expand Down Expand Up @@ -1427,8 +1450,7 @@ describe('Adwords forwarder', function () {
{
conversionId: 'AW-123123123',
enableGtag: 'True',
consentMappingWeb:
'[{"jsmap":null,"map":"some_consent","maptype":"ConsentPurposes","value":"ad_user_data"},{"jsmap":null,"map":"storage_consent","maptype":"ConsentPurposes","value":"analytics_storage"},{"jsmap":null,"map":"other_test_consent","maptype":"ConsentPurposes","value":"ad_storage"},{"jsmap":null,"map":"test_consent","maptype":"ConsentPurposes","value":"ad_personalization"}]',
consentMappingWeb: JSON.stringify(consentMap),
adPersonalizationConsentWeb: 'Granted', // Will be overriden by User Consent State
adUserDataConsentWeb: 'Granted', // Will be overriden by User Consent State
adStorageConsentWeb: 'Granted',
Expand Down Expand Up @@ -1593,8 +1615,7 @@ describe('Adwords forwarder', function () {
{
conversionId: 'AW-123123123',
enableGtag: 'True',
consentMappingWeb:
'[{"jsmap":null,"map":"some_consent","maptype":"ConsentPurposes","value":"ad_user_data"},{"jsmap":null,"map":"storage_consent","maptype":"ConsentPurposes","value":"analytics_storage"},{"jsmap":null,"map":"other_test_consent","maptype":"ConsentPurposes","value":"ad_storage"},{"jsmap":null,"map":"test_consent","maptype":"ConsentPurposes","value":"ad_personalization"}]',
consentMappingWeb: JSON.stringify(consentMap),
},
reportService.cb,
true
Expand Down

0 comments on commit b9aeaad

Please sign in to comment.