LearnNewsExamplesServices
Frontmatter
id9019
titleFix Playwright Teleportation Tests for Fixed-DOM-Order Grid
stateClosed
labels
aitestingregression
assigneestobiu
createdAtFeb 6, 2026, 7:14 PM
updatedAtFeb 6, 2026, 7:51 PM
githubUrlhttps://github.com/neomjs/neo/issues/9019
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 6, 2026, 7:51 PM

Fix Playwright Teleportation Tests for Fixed-DOM-Order Grid

Closed v12.0.0 aitestingregression
tobiu
tobiu commented on Feb 6, 2026, 7:14 PM

Objective: Update test/playwright/unit/grid/Teleportation.spec.mjs to align with the new "Fixed-DOM-Order" Row Pooling architecture. The current tests fail because they expect behaviors (DOM moves, direct VDOM structure access) that have been intentionally obsoleted by recent refactorings (#9012, #9017).

Issue 1: Expectation Mismatch (Zero Moves)

  • Failure: expect(moveNodes.length).toBe(3) received 0.
  • Reason: The Fixed-DOM-Order strategy eliminates moveNode operations for rows during scrolling.
  • Fix: Update the test to expect 0 move deltas for rows. Verify text updates count and adjust if necessary.

Issue 2: VDOM Traversal Failure

  • Failure: TypeError: Cannot read properties of undefined (reading '1') when accessing firstRenderedRow.cn[1].
  • Reason: GridBody now contains Neo.grid.Row references (placeholders) in its vdom.cn, not the full VDOM tree of the rows. The test tries to access cell cn[1] directly from the Body's VDOM, which is no longer valid.
  • Fix:
    • Resolve the Neo.grid.Row instance from the Body's items (using getComponent).
    • Access the Row's own vdom property to inspect cells and content.

Plan:

  1. Modify Teleportation.spec.mjs to assert moveNodes.length is 0.
  2. Refactor the DOM inspection logic to retrieve the Row component instance before inspecting its VDOM structure.
  3. Run the test to verify stability.

Related:

  • #9017 (Grid Body Refactor)
  • #9012 (Fixed-DOM-Order)
tobiu added the ai label on Feb 6, 2026, 7:14 PM
tobiu added the testing label on Feb 6, 2026, 7:14 PM
tobiu added the regression label on Feb 6, 2026, 7:14 PM
tobiu referenced in commit 0524911 - "test: Fix Teleportation specs for Fixed-DOM-Order Grid (#9019)" on Feb 6, 2026, 7:51 PM
tobiu
tobiu Feb 6, 2026, 7:51 PM

Input from Gemini 3 Pro:

✦ I have updated test/playwright/unit/grid/Teleportation.spec.mjs to align with the new Fixed-DOM-Order architecture.

Changes:

  1. Updated Expectations:
    • moveNodes expectation set to 0 (was 3 or 8), confirming that rows are recycled in-place without moving in the DOM.
    • insertNodes expectation set to 0 (was 3), confirming full pool reuse.
    • textUpdates expectation set to 14 (was 11), accounting for the recycling of previously "inserted" rows.
  2. Robust Row Inspection:
    • Refactored the test logic to identify rows by checking the component's rowIndex property, rather than assuming cn[0] corresponds to the top logical row. This handles the visual wrapping inherent in the fixed-order strategy.
  3. Async Synchronization:
    • Added await grid.timeout(50) after scrolling to allow child component updates (e.g., Button text) to fully settle before assertions, resolving race conditions in the test environment.
  4. VDOM Inspection:
    • Updated assertions to check .text instead of .html on button text nodes, matching Neo.button.Base implementation.

All tests are now passing. Code pushed to dev.

tobiu assigned to @tobiu on Feb 6, 2026, 7:51 PM
tobiu closed this issue on Feb 6, 2026, 7:51 PM