@@ -21,15 +21,16 @@ describe('collective.transactions', () => {
2121 cy . login ( { redirect : '/brusselstogether/transactions' } ) ;
2222 cy . contains ( 'button[data-cy=transaction-details]' , 'View Details' ) . first ( ) . click ( ) ;
2323 cy . getByDataCy ( 'download-transaction-receipt-btn' ) . first ( ) . click ( ) ;
24- cy . waitForDownload ( 'brusselstogether_2017-12-04_b961becd-cb85-6c70-6ec5-075151203084.pdf' ) . then ( file => {
25- cy . task ( 'readPdf' , file )
26- . should ( 'contain' , 'BrusselsTogether ASBL' ) // Bill from
27- . should ( 'contain' , 'Frederik' ) // Bill to
28- . should ( 'contain' , 'brusselstogetherasbl_b961becd-cb85-6c70-6ec5-075151203084' )
29- . should ( 'contain' , `Contribution #1037` )
30- . should ( 'contain' , '2017-12-04' )
31- . should ( 'contain' , 'monthly recurring subscription' )
32- . should ( 'contain' , '$10.00' ) ;
33- } ) ;
24+ cy . getByDataCy ( 'download-transaction-receipt-btn' ) . first ( ) . should ( 'have.attr' , 'data-loading' , 'true' ) ; // Downloading
25+ cy . getByDataCy ( 'download-transaction-receipt-btn' ) . first ( ) . should ( 'have.attr' , 'data-loading' , 'false' ) ; // Downloaded
26+ const filename = 'brusselstogether_2017-12-04_b961becd-cb85-6c70-6ec5-075151203084.pdf' ;
27+ cy . getDownloadedPDFContent ( filename )
28+ . should ( 'contain' , 'BrusselsTogether ASBL' ) // Bill from
29+ . should ( 'contain' , 'Frederik' ) // Bill to
30+ . should ( 'contain' , 'brusselstogetherasbl_b961becd-cb85-6c70-6ec5-075151203084' )
31+ . should ( 'contain' , `Contribution #1037` )
32+ . should ( 'contain' , '2017-12-04' )
33+ . should ( 'contain' , 'monthly recurring subscription' )
34+ . should ( 'contain' , '$10.00' ) ;
3435 } ) ;
3536} ) ;
0 commit comments