Skip to content

[Chore] Expand unit tests for store and config edge cases #12

@moakilodash

Description

@moakilodash

Problem

Only the core cart behavior is covered by tests. Edge cases in config loading, stock limits, and future persistence layers are not tested, risking regressions.

Proposed Change

Expand the test suite to cover invalid config handling, stock limit validation, empty carts, and persistence layer seams. Tests should be deterministic, fast, and have clear failure messages.

Acceptance Criteria

  • Tests added for invalid/malformed YAML config
  • Tests added for stock limit edge cases (zero, negative, over-ordering)
  • Tests added for empty and multi-item carts
  • Tests added for persistence layer (create, update, clear)
  • All tests run in under 1 second
  • Failure messages clearly describe what went wrong
  • No flaky tests

Related

Depends on (but not blocking): Issue #7 (Add lint and test automation)
See ROADMAP.md Phase 6 - Production Readiness

Contributor Lane: Testing & Tooling (Issue 8/2)
Difficulty: Easy-Medium
Related Phase: Phase 6 - Production Readiness

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions