Conversation
mhaack
requested review from
hannessolo and
sharanyavinod
and removed request for
hannessolo
August 17, 2026 11:09
… multi-sheet bug - Add nx2/test/mocks/fetch.js: generalized window.fetch mock (route matching + built-in HLX6 ping handling) so api.js-dependent tests don't each hand-roll their own mock. - Add test/nx2/utils/daConfig.test.js: direct coverage of fetchDaConfigs (legacy, hlx6, memoization, error/cache-eviction) and getFirstSheet, using the shared mock. - Refactor ewFlags.test.js to use the shared mock instead of a local, ad hoc window.fetch stub. - Fix getFirstSheet's multi-sheet branch: it read Object.keys(json)[0], which is always ':type' (not a sheet name), so it always returned undefined for multi-sheet docs. Now uses json[':names'][0], matching sheet2object's approach.
…uter nx2/test/mocks/fetch.js now mirrors api.test.js's installFetch/ restoreFetch/lastCall/callsTo exactly (single response + built-in isHlx6 ping handling), rather than a generic route-matching mock. - api.test.js now imports these from the shared module instead of defining them locally; ad hoc calls = [] resets became calls.length = 0 since calls is now an imported array reference. - ewFlags.test.js and daConfig.test.js reuse the same helper, and follow api.test.js's own convention (assign window.fetch directly after restoreFetch(), push into the shared calls array) for cases needing per-URL differentiation, instead of a bespoke routing API.
sharanyavinod
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
daConfig.jsdaConfig.jsinstallFetchwith Admin API /ping call re-useable