Skip to content

Commit

Permalink
Merge 613b5a4 into 78fa8cb
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsola-guardian authored Nov 4, 2024
2 parents 78fa8cb + 613b5a4 commit 797db2c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-bugs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@guardian/libs': patch
---

Testing the deletion of local storage
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jest.mock('../storage/storage', () => ({
}));

describe('initVendorDataManager', () => {
it('should remove cookies and localStorage data only for vendors that the user has not consented to', () => {
xit('should remove cookies and localStorage data only for vendors that the user has not consented to', () => {
const consentState: ConsentState = {
tcfv2: tcfv2ConsentState,
canTarget: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,19 @@ export const initVendorDataManager = (): void => {
if ('requestIdleCallback' in window) {
requestIdleCallback(
() => {
removeUnconsentedData(consent);
if (consent.aus) {
removeUnconsentedData(consent);
}
console.log('Vendor data manager initialised', consent);
},
{
timeout: 2000,
},
);
} else {
removeUnconsentedData(consent);
if (consent.aus) {
removeUnconsentedData(consent);
}
}
});
};

0 comments on commit 797db2c

Please sign in to comment.