LearnNewsExamplesServices
Frontmatter
id6979
titleEnhance StateProvider Test Coverage
stateClosed
labels
enhancement
assigneestobiu
createdAtJul 7, 2025, 8:01 PM
updatedAtJul 8, 2025, 1:40 AM
githubUrlhttps://github.com/neomjs/neo/issues/6979
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 8, 2025, 1:40 AM

Enhance StateProvider Test Coverage

Closed v10.0.0-beta.5 enhancement
tobiu
tobiu commented on Jul 7, 2025, 8:01 PM

Description The Neo.state.Provider has recently undergone a significant refactoring to integrate with the new Neo.core.Effect system and Neo.state.createHierarchicalDataProxy. While existing tests have been updated and are passing, there is a need to expand test coverage to ensure the robustness and reliability of the StateProvider under more complex scenarios.

Problem The current test suite for Neo.state.Provider (located at test/siesta/tests/state/Provider.mjs) primarily covers basic data manipulation and hierarchical access. It lacks comprehensive tests for advanced features and interactions, such as:

  • Formulas
  • Store management
  • Two-way data binding

Without these tests, there's a risk of regressions or unexpected behavior when new features are added or existing ones are modified.

Proposed Solution Expand the test suite for Neo.state.Provider to include the following:

  1. Formulas Testing:

    • Add tests for basic formula calculations.
    • Verify that formulas react correctly to changes in their dependencies.
    • Test formulas that depend on other formulas.
  2. Store Management Testing:

    • Add tests for binding components to Neo.data.Store instances managed by the StateProvider.
    • Verify that changes within the store (e.g., adding/removing records, updating fields) correctly trigger updates in bound components.
  3. Two-Way Binding Testing:

    • Implement tests for two-way binding between component configs and state provider data properties.
    • Ensure that changes originating from the component correctly update the state provider, and vice-versa.

Additional Context The recent refactoring of Neo.state.Provider to use Neo.core.Effect and Neo.state.createHierarchicalDataProxy has introduced a powerful new reactivity model. Comprehensive testing is crucial to validate this new architecture and prevent future issues.

tobiu assigned to @tobiu on Jul 7, 2025, 8:01 PM
tobiu added the enhancement label on Jul 7, 2025, 8:01 PM
tobiu referenced in commit 4cbe250 - "#6979 Re-Implemented & tested 2-way bindings" on Jul 7, 2025, 9:26 PM
tobiu referenced in commit 44afd90 - "#6979 more test cases" on Jul 8, 2025, 12:20 AM
tobiu referenced in commit 489ab1a - "Enhance StateProvider Test Coverage #6979" on Jul 8, 2025, 12:51 AM
tobiu referenced in commit 67a3221 - "#6979 Formulas in nested providers should combine own and parent data" on Jul 8, 2025, 12:53 AM
tobiu
tobiu Jul 8, 2025, 1:40 AM
Image
tobiu closed this issue on Jul 8, 2025, 1:40 AM
tobiu referenced in commit f1176c0 - "#6979 Re-Implemented & tested 2-way bindings" on Jul 9, 2025, 2:10 AM
tobiu referenced in commit 1596d71 - "#6979 more test cases" on Jul 9, 2025, 2:10 AM
tobiu referenced in commit f65ab86 - "Enhance StateProvider Test Coverage #6979" on Jul 9, 2025, 2:10 AM
tobiu referenced in commit 19acac5 - "#6979 Formulas in nested providers should combine own and parent data" on Jul 9, 2025, 2:10 AM