Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity Controls GPP: invalidate covered = 0 in mspa #10354

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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