Hello Ben,
Do you know what line the code stop working on? I think the issue is you are passing WebViewer an element that doesn’t exist in the DOM yet. I think you’ll need to do something like
const div = document.createElement('div');
div.id = 'test'
document.querySelector('body').appendChild(div);
const instance = await WebViewer(options, div);
and after each test you’ll need to clean up by deleteing that element from the DOM.
Besides that, another possible issue I see is you might be calling “getPDFDoc” before the document has been loaded, so you’ll need to change your test to wait for the documentLoaded event.
documentLoaded
Please let me know if the above helps or if you have any other questions
Best Regards,
Andrew Yip
Software Developer
PDFTron Systems, Inc.
www.pdftron.com