Repository navigation
test: drop the removed shortlink field from the seo.js tests - #74
Merged
Fredxd merged 1 commit intoOct 25, 2026
Merged
Conversation
AppoloDev#72 removed the Shortlink input from seo.html.twig and seo.js, but the jsdom tests in tests/js/seo.test.mjs build their own copy of the field's markup and still rendered #seofields-shortlink and expected typing in it to be persisted. seo.js no longer listens to that input, so `npm test` failed on "typing in the SEO shortlink input persists it". SeoFieldScriptTest didn't catch this: it checks that every input the script uses is rendered by the template, not that the JS test fixture matches the template. Remove shortlink from the fixture and the per-input persistence tests, and add a test that a shortlink value already stored in a record's SEO JSON is kept on the next save, as AppoloDev#72 promised.
Vondry
force-pushed
the
test/drop-shortlink-from-js-fixture
branch
from
October 24, 2026 19:59
1e728ae to
30b54ea
Compare
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.
Follow-up to #72, which removed the Shortlink field. Since that merge,
npm testfails onmain:Root cause
#72 removed the Shortlink input from
templates/seo.html.twigandassets/seo/seo.js, buttests/js/seo.test.mjsbuilds its own copy of the field's markup in jsdom. That copy still rendered#seofields-shortlinkand still expected typing in it to be persisted.seo.jsno longer listens to that input, so the stored value stays empty.The PHP test added in #72 (
SeoFieldScriptTest) didn't catch it because it only checks one direction: every inputseo.jsuses must be rendered by the template. It doesn't check that the JS test fixture matches the template.Changes
tests/js/seo.test.mjs: removeshortlinkfrom the fixture markup, the empty SEO data and the per-input "typing … persists it" tests.No change to the extension's behaviour. The leftover
shortlinkline in the commentedallow:example inconfig/config.yamlis left to #71, which removes that whole block.Tests
npm test: 23 pass, 0 fail, 1 todo (the known Seo snippet description #14 test)vendor/bin/phpunit --filter SeoFieldScriptTest: OK