Skip to content

fix: add support for HLX6 for daConfig.js using api.js config route - #672

Merged
mhaack merged 5 commits into
mainfrom
hlx6cfg
Aug 18, 2026
Merged

fix: add support for HLX6 for daConfig.js using api.js config route#672
mhaack merged 5 commits into
mainfrom
hlx6cfg

Conversation

@mhaack

@mhaack mhaack commented Aug 17, 2026

Copy link
Copy Markdown
Contributor
  • using api.js config route for daConfig.js
  • adding tests for daConfig.js
  • making installFetch with Admin API /ping call re-useable

@aem-code-sync

aem-code-sync Bot commented Aug 17, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

mhaack added 2 commits August 17, 2026 13:14
… 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.
@mhaack
mhaack merged commit c6b6bb9 into main Aug 18, 2026
3 checks passed
@mhaack
mhaack deleted the hlx6cfg branch August 18, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants