Skip to content

Separate static mock fixtures from mock API behavior #389

Description

@Lakes41

Difficulty

Intermediate

Type

refactor, structure, tech-debt

Background

The failing lib/api/mock.ts contains both mock data and API behavior, including analytics data such as MOCK_ANALYTICS_SUMMARY. The module has grown beyond a size where mixing fixtures and functions is easy to maintain.

Problem

Changes to static data require navigating a large behavior-heavy module, while changes to mock functions can accidentally affect fixture definitions or structural boundaries.

Expected outcome

Separate static mock fixtures from functions that consume or expose them, making both easier to review and modify.

Suggested implementation

Identify actual fixture collections in lib/api/mock.ts and move them into a focused fixtures module or directory. Keep mock API functions responsible for retrieving, filtering, transforming, or returning those fixtures. Preserve the current data and public behavior.

Acceptance criteria

  • Static fixtures are separated from API behavior where the existing code structure supports the split.
  • Mock functions consume fixtures through explicit imports.
  • Existing fixture values are preserved.
  • No circular dependencies are introduced.
  • The application compiles successfully.

Likely affected files/directories

  • lib/api/mock.ts
  • lib/api/mock/
  • lib/api/index.ts

Metadata

Metadata

Assignees

Labels

Third CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsintermediateIntermediate difficulty tasks requiring solid experience and some contextrefactorCode restructuring without changing external behavior or APItech-debtTechnical debt reduction, maintenance improvements, and deferred cleanup work

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions