Skip to content

Create Playwright Unit Tests for Grid-Store Interactions #9021

@tobiu

Description

@tobiu

Create Playwright Unit Tests for Grid-Store Interactions

Objective:
Create a new Playwright unit test suite (test/playwright/unit/grid/StoreInteractions.spec.mjs) to verify the interaction between the GridContainer (specifically GridBody) and its Store during runtime data mutations.

Scope:
The tests must verify that the Fixed-DOM-Order architecture is maintained during dynamic data changes. We expect minimal deltas (content updates only, no row reordering/insertion/removal) for operations that fit within the existing row pool.

Key Scenarios to Test:

  1. Runtime Insert (store.add / store.insert):

    • Insert a record at the top (index 0).
    • Verify: Visible rows should update their content (shifting data down).
    • Assert: ZERO structural deltas (moveNode, insertNode) for the rows themselves. Only content (innerHTML, text) and style (transform) updates.
  2. Runtime Remove (store.remove):

    • Remove a visible record.
    • Verify: Remaining rows shift up (content update).
    • Assert: ZERO structural deltas. Unused rows at the bottom of the pool should be hidden or cleared, not removed from DOM.
  3. Runtime Sort (store.sort):

    • Trigger a sort operation.
    • Verify: Rows display records in the new order.
    • Assert: ZERO row moves. The physical DOM rows should remain in place; only their content changes.
  4. Runtime Filter (store.filter):

    • Apply a filter that reduces the dataset.
    • Verify: Visible rows update.
    • Assert: Correct number of rows are visible. Excess rows in the pool are hidden (e.g., display: none or empty content), NOT removed from DOM.

Technical Details:

  • Use captureDeltas helper (similar to Pooling.spec.mjs) to inspect VDOM actions.
  • Ensure Neo.config.useVdomWorker is false to test logic synchronously.
  • Mock ResizeObserver and DomAccess as needed.

Why:
To ensure that standard store operations do not break the high-performance rendering strategy of the new Grid implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    aiperformancePerformance improvements and optimizationstesting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions