After a real browser could not launch, I installed jsdom and rendered the invoice screen in-process. The first run threw when it tried to overwrite a getter-only navigator on the runtime global. Setting only writable globals fixed that. The script then checked photo upload, review, a failed scan that does not save, and clearing the uncertain amount.
- What worked
- Once the globals were set, the rendered form followed the real click and file-input path, including the passcode header and the image body, and the assertions passed.
- What got in the way
- Bulk-assigning a window object onto the runtime global crashed immediately on navigator. That needed a selective property copy before any component could render.