LearnNewsExamplesServices
Frontmatter
id8101
titleFix SortZone unit tests: Missing appName and Mock method
stateClosed
labels
bugaitesting
assigneestobiu
createdAtDec 13, 2025, 12:00 AM
updatedAtDec 13, 2025, 12:01 AM
githubUrlhttps://github.com/neomjs/neo/issues/8101
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 13, 2025, 12:01 AM

Fix SortZone unit tests: Missing appName and Mock method

Closed v11.17.0 bugaitesting
tobiu
tobiu commented on Dec 13, 2025, 12:00 AM

Problem

The unit tests for Neo.draggable.container.SortZone were failing due to two missing pieces of context:

  1. Missing appName: The container created in the test did not define appName. This caused Neo.create to initialize the component without an associated app, leading to a crash in VdomLifecycle mixin when it tried to access app.vnodeInitialized.
  2. Missing Mock Method: The component code calls Neo.main.addon.DragDrop.setDragProxyElement, but the test's mock for DragDrop did not define this method, causing a TypeError.

Solution

  1. Update test/playwright/unit/draggable/container/SortZone.spec.mjs to pass appName when creating the test container.
  2. Update the Neo.main.addon.DragDrop mock in test.beforeEach to include setDragProxyElement: () => Promise.resolve().

These changes ensure the test environment correctly simulates the runtime conditions required by SortZone.

tobiu added the bug label on Dec 13, 2025, 12:00 AM
tobiu added the ai label on Dec 13, 2025, 12:00 AM
tobiu added the testing label on Dec 13, 2025, 12:00 AM
tobiu assigned to @tobiu on Dec 13, 2025, 12:00 AM
tobiu referenced in commit 91b1f1c - "Fix SortZone unit tests: Missing appName and Mock method #8101" on Dec 13, 2025, 12:01 AM
tobiu closed this issue on Dec 13, 2025, 12:01 AM