You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
portfolioStore has no tests: portfolio aggregation state is uncovered
Labels / Complexity: testing · Medium Complexity — Medium
Problem
portfolioStore (src/store/portfolioStore.ts) holds the aggregated portfolio the dashboard renders. It has no tests — and it is the store that will consume the mock-backed PortfolioService (#20), so its behavior must be pinned before the data source changes.
Why this is architecturally hard
Aggregation is the test design. The store merges holdings/values into the dashboard's derived state; tests must pin how partial data is combined.
It is the mock-migration seam. With issue14 #20 replacing mock holdings, tests written now freeze the store's contract so the migration cannot silently change what the dashboard shows.
Acceptance criteria
Tests cover portfolio load, aggregation, and empty/error states.
portfolioStore has no tests: portfolio aggregation state is uncovered
Labels / Complexity: testing · Medium Complexity — Medium
Problem
portfolioStore(src/store/portfolioStore.ts) holds the aggregated portfolio the dashboard renders. It has no tests — and it is the store that will consume the mock-backedPortfolioService(#20), so its behavior must be pinned before the data source changes.Why this is architecturally hard
Acceptance criteria
npm test.Out of scope
The portfolio mock migration (#20); other stores.
Getting started
src/store/portfolioStore.ts— the storesrc/store/__tests__/transactionStore.test.ts— the patternCommands:
npm test.Good first files to read:
src/store/portfolioStore.ts.