Skip to content

Commit

Permalink
Activity Controls GPP: invalidate covered = 0 in mspa (#10354)
Browse files Browse the repository at this point in the history
* Update activityControls.js

* Update activityControls_spec.js
  • Loading branch information
patmmccann committed Aug 11, 2023
1 parent 934f5a9 commit 1678443
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/mspa/activityControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export function isBasicConsentDenied(cd) {
// minors 13+ who have not given consent
cd.KnownChildSensitiveDataConsents[0] === 1 ||
// minors under 13 cannot consent
isApplicable(cd.KnownChildSensitiveDataConsents[1]);
isApplicable(cd.KnownChildSensitiveDataConsents[1]) ||
// covered cannot be zero
cd.MspaCoveredTransaction === 0;
}

export function sensitiveNoticeIs(cd, value) {
Expand Down
6 changes: 6 additions & 0 deletions test/spec/libraries/mspa/activityControls_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ describe('Consent interpretation', () => {
}));
expect(result).to.equal(true);
});
it('should be true (basic consent conditions do not pass) with covered set to zero (invalid state)', () => {
const result = isBasicConsentDenied(mkConsent({
MspaCoveredTransaction: 0
}));
expect(result).to.equal(true);
});
it('should not deny when consent for under-13 is null', () => {
expect(isBasicConsentDenied(mkConsent({
KnownChildSensitiveDataConsents: [0, null]
Expand Down

0 comments on commit 1678443

Please sign in to comment.