Skip to content

Site admin: e2e for the one dialog, plus optional nodeIds on content replace - #157

Merged
btopro merged 4 commits into
site-admin-shell-e2efrom
site-admin-sections-e2e
Oct 30, 2026
Merged

btopro merged 4 commits into
site-admin-shell-e2efrom
site-admin-sections-e2e

Conversation

@btopro

@btopro btopro commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Refs haxtheweb/issues#3180 · Companion to haxtheweb/webcomponents#1031 · Stacked on #156

This PR changes the settings e2e tests and makes one small backend addition (below). The PHP mirror of the backend change is haxtheweb/haxcms-php#716. No build files change.

Backend: page list on replace

  • src/siteRoutes/v1/routes/siteSearch.js: replaceContent accepts an optional nodeIds array of page ids, used by the site admin Content section's page checkboxes.
    • A non-empty list rewrites only those pages.
    • If the list is absent, empty or not an array, behavior is exactly what it is today.
    • Search is unchanged.
  • src/openapi/site-spec.yaml: documents nodeIds, worded the same as the PHP spec.
  • test/unit/site-search-route.test.cjs: 6 new tests. When nodeIds is left out, the response and commit are exactly the old ones; an empty list, a list of blanks, or a non-array value gives the same result as leaving it out.
  • npm test: 2987 tests, 0 failures.

What it touches

  • test/e2e/site-seo, site-theme, site-blocks-editor-settings (.e2e.test.cjs): clickDialogSave clicks Save in the shell's action bar (.ftr button.save, waiting for it to enable) when the section renders inside haxcms-site-admin. Otherwise it falls back to the dialog's own button.action Save.
  • All four settings tests: the card helper also matches the section rail (button.rail-item .label). After a save the dialog reopens on the section, so the launcher cards aren't there.
  • site-blocks-editor-settings: the test toggled img, which is a required block. Its checkbox is disabled and it can't be turned off. The old Save button was always enabled, so the test passed while saving nothing that changed. The new Save rightly stays off. The test now toggles video-player, or failing that the first block checkbox that isn't disabled.
  • test/e2e/helpers/selectors.cjs: adds railButton.

Results

I ran these with webcomponents#1031 overlaid into the build:

  • Details, SEO, Theme and Blocks/Editor all pass. Blocks/Editor fails on main today.
  • Outline import and outline ops, revisions, files ops and files phase 2, export site and export formats, edit content, and page management also pass, with test files unchanged (29 tests).
  • Precheck passes.

Merge this together with webcomponents#1031.

Page history

revisions.e2e.test.cjs now follows the redesigned revisions screen, Page history, which sits inside the site admin dialog (webcomponents#1031, Round 6). The UI check asserts four things:

  • the screen renders inside the dialog;
  • it opens on the current version;
  • Restore is off for the current version;
  • choosing an older version shows its change and turns Restore on.

The API checks (list, detail, restore plus a new commit) are unchanged. 7/7 pass against that build, with 0 accessibility violations. The revisions-dialog visual baseline needs a refresh, since the screen is new. The pre-commit formatter rewrote the whole file in one commit; the next commit puts the file's own formatting back, so the net change is only the UI check.

https://claude.ai/code/session_01PfFvVUkTpLX8DucJwVoaVk



Generated by Claude Code

SEO, Theme and Blocks/Editor save from the shell's action bar when their
section renders inside haxcms-site-admin (falling back to the dialog's
own Save otherwise), and the card helper also uses the section rail,
since the dialog reopens on the section after a save. The Blocks test now
toggles a block people can turn off: img is a required primitive whose
checkbox is disabled, so toggling it changed nothing (the old always-on
Save hid that). Refs haxtheweb/issues#3180.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfFvVUkTpLX8DucJwVoaVk
@codesandbox

codesandbox Bot commented Oct 29, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web Editor • VS Code • Insiders

Open Preview

replaceContent accepts nodeIds (array of page ids). A non-empty list
rewrites only those pages; absent, empty or non-array keeps today's
behavior exactly. Search is unchanged. Mirrored in haxcms-php with the
same OpenAPI text. Used by the site admin Content section's page
checkboxes. Refs haxtheweb/issues#3180.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfFvVUkTpLX8DucJwVoaVk
@btopro btopro changed the title e2e: settings tests follow every section into the one admin dialog Site admin: e2e for the one dialog, plus optional nodeIds on content replace Oct 29, 2026
The revisions dialog is now Page history inside the site admin dialog
(haxtheweb/webcomponents#1031): a timeline of version rows and one
Restore button for the version on screen. The UI check now asserts it
renders in the dialog, opens on the current version with Restore off,
and that choosing an older version shows its change with Restore on.
The API checks are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfFvVUkTpLX8DucJwVoaVk
The pre-commit formatter rewrote the whole file in the previous commit.
Restore its existing formatting so the change is only the Page history
UI check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PfFvVUkTpLX8DucJwVoaVk
@btopro
btopro merged commit fcce30a into site-admin-shell-e2e Oct 30, 2026
5 of 6 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 2026
@btopro
btopro deleted the site-admin-sections-e2e branch October 30, 2026 17:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants