test(core): add unit tests for least-covered core modules - #3
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
test(core): add unit tests for least-covered core modules#3devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Add unit tests for pure-logic modules in packages/core (previously ~1% coverage): utils, issue/project status+priority config, and the zustand stores (issue view/filter, selection, draft, recent-issues, scope, navigation, modals, i18n). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Cover issue status/priority config and the issue view, selection, draft, recent-issues, and scope zustand stores. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/core(the headless business-logic package) was the least-covered TypeScript package — only the 3 platform-storage files had tests (~1% statement coverage), while ~87 other source files had none. This PR adds unit tests for its pure-logic modules, taking coverage of the tested files to ~89% statements / ~92% lines. No source code was changed — tests only.How coverage was assessed
Ran
vitest --coverageper package.packages/corestood out: 90 source files, 3 tested.packages/viewshad 7 test files,apps/webhad 1. The Go backend (server/) is already broadly tested (30+_test.gofiles). So the largest, most testable coverage gap waspackages/core, and within it the pure functions / zustand stores that need no DOM or network mocking.Modules covered (all previously 0%)
utils.ts—timeAgoboundary behavior (just now / m / h / d) andshortID.issues/config/status.ts&priority.ts— ordering, board-column exclusion ofcancelled, config completeness for every enum value.projects/config.ts— project status/priority ordering + config completeness.issues/stores/view-store.ts— the richest target: filter toggles, the non-obvioushideStatus/showStatusbranches (e.g.hideStatuswith no active filter selectsALL_STATUSESminus one),clearFilterspreserving view mode/sort, card-property and collapsed-column toggles. Tested via thecreateIssueViewStorefactory for isolation.issues/stores/{selection,draft,recent-issues,issues-scope}-store.ts— set/dedup logic, draft merge/clear/hasDraft, recent-visit dedup + 20-item cap, scope switching.navigation/store.ts—onPathChangeexcludes/loginand/pair/prefixes but records paths that merely contain them.modals/store.ts— open/close and data handling.i18n/store.ts—setLanguage/initializeFromCookieusing minimaldocument/windowglobal stubs (core runs in a Node, non-DOM test env).Notes
pnpm --filter @multica/core testgoes from 8 → 74 passing tests.tsc --noEmitpasses; eslint reports no issues on the new files.vitest/rolldowntoolchain requires Node ≥20.19; use Node 22 (matches CI) to run the suite locally.Link to Devin session: https://app.devin.ai/sessions/c4819c9679c64321bf2f6e5268263691
Requested by: @killerleon94