File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
tests/test-team/template-mgmt-e2e-tests Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments