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

bugfix/CXSPA-6934/9292/9315: CDC Consent Management Issue #19916

Draft
wants to merge 20 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore: renaming
  • Loading branch information
anjana-bl committed Jan 23, 2025
commit 80d9e93dbcc09c612680254de1afbac390b5889d
Original file line number Diff line number Diff line change
@@ -70,14 +70,14 @@ describe('CdcConsentManagementService', () => {
expect(service.getCdcConsentIDs).toHaveBeenCalled();
});
});
describe('checkIfMandatory', () => {
describe('isConsentMandatory', () => {
it('should return true if consent is mandatory', () => {
service.getCdcConsentIDs = createSpy().and.returnValue(['a']);
expect(service.checkIfMandatory('a')).toEqual(true);
expect(service.isConsentMandatory('a')).toEqual(true);
});
it('should return false if consent is not mandatory', () => {
service.getCdcConsentIDs = createSpy().and.returnValue(['a']);
expect(service.checkIfMandatory('b')).toEqual(false);
expect(service.isConsentMandatory('b')).toEqual(false);
});
});
});
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ export class CdcConsentManagementComponentService extends ConsentManagementCompo
return consentIDs;
}

checkIfMandatory(id: string): boolean {
isConsentMandatoryConsent(id: string): boolean {
return this.getCdcConsentIDs(true).includes(id);
}
}
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ class MockCdcConsentManagementComponentService
{
getConsents = createSpy().and.returnValue(of([]));
getCdcConsentIDs = createSpy().and.returnValue(of([]));
checkIfMandatory = createSpy().and.returnValue(true);
isConsentMandatory = createSpy().and.returnValue(true);
}

class MockAnonymousConsentsService
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ class MockCdcConsentManagementService
implements Partial<CdcConsentManagementComponentService>
{
getCdcConsentIDs = createSpy();
checkIfMandatory(_id: string): boolean {
isConsentMandatory(_id: string): boolean {
return true;
}
}
@@ -420,7 +420,7 @@ describe('CdcRegisterComponentService', () => {
expect(fb.array).toHaveBeenCalled();
});
it('loadAdditionalConsents', () => {
spyOn(cdcConsentManagementService, 'checkIfMandatory')
spyOn(cdcConsentManagementService, 'isConsentMandatory')
.withArgs('consent2.terms2')
.and.returnValue(false)
.withArgs('consent3.terms3')
Original file line number Diff line number Diff line change
@@ -179,7 +179,7 @@ export class CDCRegisterComponentService extends RegisterComponentService {
const consentArray = this.fb.array([]);
const templates: ConsentTemplate[] = this.fetchCdcConsentsForRegistration();
for (const template of templates) {
const isMandatory = this.cdcConsentManagementService.checkIfMandatory(
const isMandatory = this.cdcConsentManagementService.isConsentMandatory(
template.id ?? ''
);
consentArray.push(
@@ -209,7 +209,7 @@ export class CDCRegisterComponentService extends RegisterComponentService {
const returnConsent: any = {};
returnConsent['template'] = template;
returnConsent['required'] =
this.cdcConsentManagementService.checkIfMandatory(template.id ?? '');
this.cdcConsentManagementService.isConsentMandatory(template.id ?? '');
returnConsents.push(returnConsent);
}
return returnConsents;
Loading
Oops, something went wrong.