@@ -12,22 +12,31 @@ describe('getSimplePDFElements', () => {
1212 <a href="https://pdfobject.com/pdf/sample-3pp.pdf">PDF link</a>
1313 <a href="https://example.com/some-pdf-without-extension" class="simplepdf">Regular link with class</a>
1414 <button class="simplepdf">Button with class</button>
15- <a href="https://yourcompany.simplepdf.com/form/d8d57ec7-f3e9-4fc9-8cc5-4a92c02d30d0" class="simplepdf">SimplePDF form link</a>
15+ <a href="https://yourcompany.simplepdf.com/form/d8d57ec7-f3e9-4fc9-8cc5-4a92c02d30d0">SimplePDF form link</a>
16+ <a href="https://yourcompany.simplepdf.com/documents/d8d57ec7-f3e9-4fc9-8cc5-4a92c02d30d0">SimplePDF document link</a>
1617 <!--Should NOT detect below-->
1718 <a href="https://pdfobject.com/pdf/sample-3pp.pdf" class="exclude-simplepdf">PDF link with class exclusion</a>
1819 <a href="https://yourcompany.simplepdf.com/form/d8d57ec7-f3e9-4fc9-8cc5-4a92c02d30d0" class="exclude-simplepdf">SimplePDF form link with exclusion</a>
1920 <a href="https://www.pdfsomething.com/anything">Regular link containing .pdf</a>
2021 <a href="https://www.website.com/some-pdf">Should not be opened with SimplePDF</a>
2122 <a href="https://www.website.com/some-other.pdf.png">Should not be opened with SimplePDF</a>
23+ <a href="https://www.simplepdf.app/s/article/How-to-Manage-PDF-Settings">Should not be opened with SimplePDF</a>
24+ <a href="https://www.app.pdf/some-url">Should not be opened with SimplePDF</a>
2225 </body>
2326 </html>
2427 ` ,
2528 { url : 'http://localhost' } ,
2629 ) ;
2730 const detectedElements = getSimplePDFElements ( dom . window . document ) ;
28- expect ( detectedElements ) . toHaveLength ( 4 ) ;
31+ expect ( detectedElements ) . toHaveLength ( 5 ) ;
2932 expect ( detectedElements . map ( ( { innerHTML } ) => innerHTML ) ) . toStrictEqual (
30- expect . arrayContaining ( [ 'Button with class' , 'PDF link' , 'Regular link with class' , 'SimplePDF form link' ] ) ,
33+ expect . arrayContaining ( [
34+ 'Button with class' ,
35+ 'PDF link' ,
36+ 'Regular link with class' ,
37+ 'SimplePDF form link' ,
38+ 'SimplePDF document link' ,
39+ ] ) ,
3140 ) ;
3241 } ) ;
3342} ) ;
0 commit comments