fix(e2e): rewrite insert-modes specs 1/2/4 to JSON data-mode contract - #273
Merged
Conversation
Specs 1, 2, 4 mocked text/html fragments and asserted raw-HTML divs, which are unsatisfiable under the data-mode-only get directive contract. Rewrite all three to mock application/json array responses shaped for the fixtures' as= keys and assert template-rendered elements: - Spec 1 (append): JSON items mock, assert btn-item ordering (page 1 before page 2 in DOM) - Spec 2 (prepend): new insert-prepend-data.html fixture with proper data-mode attributes (as/each/template); assert prepend-item ordering (page 2 before page 1 in DOM) - Spec 4 (sentinel): JSON items mock, assert data-nojs-sentinel attachment, aria-hidden, and zero computed height Add insert-prepend-data.html because the existing insert-prepend.html has no as= attribute, no each loop, and no template — incompatible with data-mode rendering. Spec 3 (replace mode) unchanged and still green. 12/12 pass (chromium + firefox + webkit), 36/36 with --repeat-each=3.
This was referenced Jul 10, 2026
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
insert-modes.spec.tsto mockapplication/jsonarray responses instead of unsatisfiabletext/htmlfragmentse2e/examples/insert-prepend-data.htmlfixture with proper data-mode attributes (as="items",each,template) since the existinginsert-prepend.htmlhas no data-mode rendering capability--repeat-each=3What changed
text/html, asserteddata-test="item"divsapplication/jsonarray, assertsbtn-itemtemplate elements, verifies page-1 before page-2 in DOM ordertext/html, asserteddata-test="item"divs, usedinsert-prepend.html(no as/each/template)application/jsonarray, uses newinsert-prepend-data.htmlfixture, assertsprepend-itemelements, verifies page-2 before page-1 in DOM ordertext/html, asserted sentinelapplication/jsonarray, asserts[data-nojs-sentinel]attached,aria-hidden="true", zero computed heightTest plan
E2E_PORT=3999 npx playwright test --config e2e/playwright.config.ts e2e/tests/insert-modes.spec.ts-- 12/12 green--repeat-each=3-- 36/36 green (no flakiness)Resolves NOJS-265 (epic NOJS-264)