test: create pages through addPage from @jahia/cypress - #778
Open
jahia-carp wants to merge 1 commit into
Open
Conversation
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.
🦜 ChachalogNo changelog entries detected. Learn more about Chachalog. Create a new entry online or run |
commit: |
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.
Summary
addSimplePageintests/cypress/utils/helpers.tswas a local copy of a page-creation helper that six Jahia repositories each maintained separately.@jahia/cypress8.4.0 shipsaddPage, 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.
addPagewas 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.ts—addSimplePagedelegates toaddPageinstead of building theaddNodemutation itself. Its signature is unchanged.addNodestays imported: this file still calls it directly elsewhere.tests/package.json—@jahia/cypressfrom^7.0.0to^8.4.0, with the lockfile.This copy already passed
children,mixinsandpropertiesstraight through and added no default page structure, so the delegation is one-to-one and adds no behaviour. It also sent atitlevariable thataddNodedoes not declare; it reached nothing and is gone.Validation
Measured locally, and compared against the same commands on the base:
yarn installsucceeds and resolves 8.4.0.npx tsc --noEmit -p cypress/tsconfig.jsonreports the same 11 errors before and after, identical line for line. They are pre-existingApolloQueryResulttype 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-testson 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 configuredprintWidthof 100.Documentation
None. The helper's name, signature and behaviour are unchanged.
ADR
None.
No changelog fragment: test-only change, no user-visible impact.