Test for undefined Bookreader components (e.g. $BRnav)
Description
re: #161
In certain cases where no nav bar is present for a book (e.g. a book w/ admin privileges w/ no preview), we can’t expect a nav bar to appear, causing br.refs.$BRnav to be undefined.
What problem are we solving? What does the experience look like today? What are the symptoms? How can one reproduce the problem?
Evidence / Screenshot (if possible)
Include evidence of the problem or provide a screenshot.
The bookreader won't fully load due to js error halting execution. In today's regression case, the "admin" bar failed to load (which allows users to QA a book). This is a mission critical use case for our scanning centers to do QA and so such an admin privileged book should be included in our testing:
https://archive.org/details/alopeciaareata0000levy
I’d like to work on this issue.
From your description, it sounds like the fix involves adding checks so that if br.refs.$BRnav is undefined, it won’t cause an error.
However, I’m not fully sure how to reproduce the issue locally — could you please clarify the steps or the specific type of book (admin / no preview) that triggers it?
Also, once I can reproduce it, I’d like to confirm where the helper function or conditional logic should ideally be placed in the codebase (since the src/js structure seems to have changed).