Skip to content

test: create pages through addPage from @jahia/cypress - #778

Open
jahia-carp wants to merge 1 commit into
mainfrom
test/use-addpage-from-jahia-cypress
Open

test: create pages through addPage from @jahia/cypress#778
jahia-carp wants to merge 1 commit into
mainfrom
test/use-addpage-from-jahia-cypress

Conversation

@jahia-carp

Copy link
Copy Markdown

Summary

addSimplePage in tests/cypress/utils/helpers.ts was a local copy of a page-creation helper that six Jahia repositories each maintained separately. @jahia/cypress 8.4.0 ships addPage, so the copy is no longer needed: this helper keeps its name and signature and now delegates to it.

This is the largest of the six by usage — thirty-eight calls across thirty-one spec files — and none of them moves.

Why

The duplication is tracked by https://github.com/Jahia/jahia-private/issues/3251. addPage was added in Jahia/jahia-cypress#245 and published in 8.4.0.

Two repositories have already migrated with all checks green, each returning the same test counts as its base run: Jahia/client-cache-control#83 and Jahia/site-settings-seo#376.

Changes

  • tests/cypress/utils/helpers.tsaddSimplePage delegates to addPage instead of building the addNode mutation itself. Its signature is unchanged. addNode stays imported: this file still calls it directly elsewhere.
  • tests/package.json@jahia/cypress from ^7.0.0 to ^8.4.0, with the lockfile.

This copy already passed children, mixins and properties straight through and added no default page structure, so the delegation is one-to-one and adds no behaviour. It also sent a title variable that addNode does not declare; it reached nothing and is gone.

Validation

Measured locally, and compared against the same commands on the base:

  • yarn install succeeds and resolves 8.4.0.
  • npx tsc --noEmit -p cypress/tsconfig.json reports the same 11 errors before and after, identical line for line. They are pre-existing ApolloQueryResult type mismatches in the specs and none of them involves this helper.

The e2e suite has not been run locally — no Jahia was started for it. integration-tests on this pull request is what proves the migration, since it exercises the thirty-eight call sites against a live Jahia.

Prettier was not run: the repository root installs under node 26 per its mise.toml, which this machine does not have. The changed lines follow the file's existing style and stay under the configured printWidth of 100.

Documentation

None. The helper's name, signature and behaviour are unchanged.

ADR

None.


No changelog fragment: test-only change, no user-visible impact.

addSimplePage keeps its signature and now delegates to addPage, so none of its thirty-eight call sites moves. This helper already passed children straight through, so the delegation is one-to-one, and addNode stays imported because this file calls it directly elsewhere.

This needs @jahia/cypress 8.4.0, which ships addPage. Nothing this repository calls was broken between 7.0.0 and 8.4.0.
@jahia-carp jahia-carp added the 🗒️ no-changelog No release notes or changelog entry should be added for this PR or Issue label Aug 31, 2026
@github-actions

Copy link
Copy Markdown

🦜 Chachalog

No changelog entries detected. Learn more about Chachalog.

Create a new entry online or run npx chachalog@0.5.4 prompt to create a new entry locally.

@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

yarn add https://pkg.pr.new/@jahia/create-module@778.tgz
yarn add https://pkg.pr.new/@jahia/javascript-modules-library@778.tgz
yarn add https://pkg.pr.new/@jahia/vite-plugin@778.tgz

commit: 45d90e7

@jahia-carp jahia-carp self-assigned this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗒️ no-changelog No release notes or changelog entry should be added for this PR or Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant