Background
The JS API module ('ext.readingLists.api/index.js') has test coverage gaps. Several code paths were never exercised by the Jest suite -- things like what happens when the MediaWiki API doesn't return normalized or redirects in its response, the title-normalization-then-redirect lookup chain, and most of the toBase64/fromBase64 functions.
Goal
Add the missing tests so that the branch coverage for this file goes up and CI can catch regressions in those paths.
Acceptance Criteria for done
- Branch coverage for ext.readingLists.api/index.js increases
- Test for getPagesFromManifest where the API response has no normalized or redirects fields
- Test for getPagesFromManifest where a title gets normalized and then redirected before being matched to a page
- Test for fromBase64 where the encoded data already has a name set and covering basic encoding, non-Latin-1 input, and a round-trip back through fromBase64
- All existing tests still pass