-
-
Notifications
You must be signed in to change notification settings - Fork 202
Create Playwright Unit Tests for Grid-Store Interactions #9021
Description
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:
-
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) andstyle(transform) updates.
-
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.
-
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.
-
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: noneor empty content), NOT removed from DOM.
Technical Details:
- Use
captureDeltashelper (similar toPooling.spec.mjs) to inspect VDOM actions. - Ensure
Neo.config.useVdomWorkerisfalseto test logic synchronously. - Mock
ResizeObserverandDomAccessas needed.
Why:
To ensure that standard store operations do not break the high-performance rendering strategy of the new Grid implementation.