-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Afficher les données de campagnes supprimées non anonymisé (P…
- Loading branch information
Showing
3 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
.../campaign-participation/unit/domain/models/CampaignParticipationForUserManagement_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { CampaignParticipationForUserManagement } from '../../../../../../src/prescription/campaign-participation/domain/models/CampaignParticipationForUserManagement.js'; | ||
import { expect } from '../../../../../test-helper.js'; | ||
|
||
describe('Unit | Domain | Models | CampaignParticipationForUserManagement', function () { | ||
describe('#constructor', function () { | ||
it('should not return campaign participation informations when campaignParticipationId is missing', function () { | ||
// given | ||
const campaignParticipation = new CampaignParticipationForUserManagement({ | ||
id: 1, | ||
campaignParticipationId: null, | ||
participantExternalId: 'externalId', | ||
status: 'TOTO', | ||
campaignId: 3, | ||
campaignCode: 'AZERTY', | ||
createdAt: new Date('2020-01-01'), | ||
sharedAt: new Date('2022-01-01'), | ||
updatedAt: new Date('2022-01-01'), | ||
deletedAt: new Date('2023-01-01'), | ||
organizationLearnerFirstName: 'Jean', | ||
organizationLearnerLastName: 'Meuh', | ||
}); | ||
|
||
// then | ||
expect(campaignParticipation.id).to.be.deep.equals(1); | ||
expect(campaignParticipation.createdAt).to.be.deep.equals(new Date('2020-01-01')); | ||
expect(campaignParticipation.deletedAt).to.be.deep.equals(new Date('2022-01-01')); | ||
expect(campaignParticipation.organizationLearnerFullName).to.be.equals('-'); | ||
|
||
expect(campaignParticipation.campaignParticipationId).to.be.null; | ||
expect(campaignParticipation.participantExternalId).to.be.null; | ||
expect(campaignParticipation.status).to.be.null; | ||
expect(campaignParticipation.campaignId).to.be.null; | ||
expect(campaignParticipation.campaignCode).to.be.null; | ||
expect(campaignParticipation.sharedAt).to.be.null; | ||
expect(campaignParticipation.status).to.be.null; | ||
}); | ||
|
||
it('should campaign participation informations when campaignParticipationId existing', function () { | ||
// given | ||
const campaignParticipation = new CampaignParticipationForUserManagement({ | ||
id: 1, | ||
campaignParticipationId: 18, | ||
participantExternalId: 'externalId', | ||
status: 'TOTO', | ||
campaignId: 3, | ||
campaignCode: 'AZERTY', | ||
createdAt: new Date('2020-01-01'), | ||
sharedAt: new Date('2022-01-01'), | ||
updatedAt: new Date('2022-01-01'), | ||
deletedAt: new Date('2023-01-01'), | ||
organizationLearnerFirstName: 'Jean', | ||
organizationLearnerLastName: 'Meuh', | ||
}); | ||
|
||
// thenid: 1, | ||
expect(campaignParticipation.campaignParticipationId).to.be.equals(18); | ||
expect(campaignParticipation.participantExternalId).to.be.equals('externalId'); | ||
expect(campaignParticipation.status).to.be.equals('TOTO'); | ||
expect(campaignParticipation.campaignId).to.be.equals(3); | ||
expect(campaignParticipation.campaignCode).to.be.equals('AZERTY'); | ||
expect(campaignParticipation.createdAt).to.be.deep.equals(new Date('2020-01-01')); | ||
expect(campaignParticipation.sharedAt).to.be.deep.equals(new Date('2022-01-01')); | ||
expect(campaignParticipation.deletedAt).to.be.deep.equals(new Date('2023-01-01')); | ||
expect(campaignParticipation.organizationLearnerFullName).to.be.equals('Jean Meuh'); | ||
}); | ||
}); | ||
}); |