Skip to content

Commit cd6b069

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/CCM-10555-client-config-endpoint-2
2 parents 1ee59d9 + 40f42d1 commit cd6b069

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

tests/test-team/template-mgmt-e2e-tests/template-mgmt-letter-full.e2e.spec.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,32 @@ function requestProof(
205205

206206
expect(pdfHrefs.length).toBeGreaterThan(0);
207207

208-
for (const href of pdfHrefs) expect(href).toContain(templateKey.id);
208+
const downloadBucketMetadata = await Promise.all(
209+
pdfHrefs.map((href) => {
210+
const [, downloadBucketPath] =
211+
(href as string).match(
212+
// eslint-disable-next-line security/detect-non-literal-regexp
213+
new RegExp(
214+
`/templates/files/(${templateKey.owner}/proofs/${templateKey.id}/[^/]+)/?$`
215+
)
216+
) ?? [];
217+
218+
if (!downloadBucketPath) {
219+
throw new Error(
220+
`Could not determine bucket path based on URL: ${href}`
221+
);
222+
}
223+
224+
return templateStorageHelper.getS3Metadata(
225+
process.env.TEMPLATES_DOWNLOAD_BUCKET_NAME,
226+
downloadBucketPath
227+
);
228+
})
229+
);
230+
231+
for (const [i, entry] of downloadBucketMetadata.entries()) {
232+
expect(entry, JSON.stringify(pdfHrefs[i])).not.toBeNull();
233+
}
209234

210235
await previewTemplatePage.clickContinueButton();
211236
}).toPass({ timeout: 60_000 });

0 commit comments

Comments
 (0)