File tree 2 files changed +6
-4
lines changed
src/certification/results/application
tests/certification/results/unit/application
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,9 @@ const downloadDivisionCertificates = async function (
140
140
division,
141
141
} ) ;
142
142
143
- if ( certificates . every ( ( certificate ) => certificate instanceof V3CertificationAttestation ) ) {
143
+ if ( certificates . some ( ( certificate ) => certificate instanceof V3CertificationAttestation ) ) {
144
+ const v3Certificates = certificates . filter ( ( certificate ) => certificate instanceof V3CertificationAttestation ) ;
145
+
144
146
const normalizedDivision = normalizeAndRemoveAccents ( division ) ;
145
147
146
148
const translatedFileName = i18n . __ ( 'certification-confirmation.file-name' , {
@@ -150,7 +152,7 @@ const downloadDivisionCertificates = async function (
150
152
return h
151
153
. response (
152
154
dependencies . v3CertificationAttestationPdf . generate ( {
153
- certificates,
155
+ certificates : v3Certificates ,
154
156
i18n,
155
157
} ) ,
156
158
)
Original file line number Diff line number Diff line change @@ -418,8 +418,8 @@ describe('Certification | Results | Unit | Application | certificate-controller'
418
418
clock . restore ( ) ;
419
419
} ) ;
420
420
421
- describe ( 'when attestations are for v3 ' , function ( ) {
422
- it ( 'should return division attestations in PDF binary format' , async function ( ) {
421
+ describe ( 'when there are at least one v3 attestation ' , function ( ) {
422
+ it ( 'should return only v3 division attestations in PDF binary format' , async function ( ) {
423
423
// given
424
424
const userId = 1 ;
425
425
const i18n = getI18n ( ) ;
You can’t perform that action at this time.
0 commit comments