refactor: quality-of-life improvements — test coverage, type safety, reduce duplication#776
Open
devin-ai-integration[bot] wants to merge 4 commits into
Open
refactor: quality-of-life improvements — test coverage, type safety, reduce duplication#776devin-ai-integration[bot] wants to merge 4 commits into
devin-ai-integration[bot] wants to merge 4 commits into
Conversation
…reduce duplication - Improve reports.js test coverage from 64% to 94% with PDF generation success-path tests, CSV writer verification, and edge case coverage - Fix DashboardPage @ts-expect-error suppressions by migrating Grid from deprecated item/xs props to Grid2 size prop API - Extract shared getApiErrorMessage utility to replace 8 duplicated inline error type casts across ClientsPage, WorkEntriesPage, LoginPage - Add explicit radix parameter (10) to all parseInt calls in backend routes
Contributor
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:
|
Extract setupClientAndEntries, setupPdfMock, and getLastPdfInstance helpers to deduplicate mock setup across PDF/CSV export tests.
…nd setupCsvMock helpers
The parseInt radix changes touched lines inside already-duplicated route handler blocks, causing SonarCloud to flag them as new duplication (4.3% vs 3% threshold). Reverting this low-impact improvement to pass CI.
|
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
Three targeted quality improvements, no functional changes:
reports.js test coverage: 64% → 94% — Added 7 tests covering the PDF generation success path (content rendering, empty entries, page overflow at y>700, separator lines every 5 entries, null descriptions) and CSV writer verification (correct entries passed to
writeRecords, header/filename configuration). Remaining uncovered lines (127-134) are theres.downloadcallback which requires a real filesystem file. Test helpers (setupClientAndEntries,setupPdfMock,requestPdfAndGetMock) reduce mock duplication.DashboardPage
@ts-expect-errorremoval — Migrated 3 Grid usages from deprecated v1item xs={12}prop syntax to v2size={{ xs: 12 }}API, consistent with howReportsPagealready uses Grid.Shared
getApiErrorMessageutility — Extracted the repeated error extraction pattern:Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/3ebb41e8a4f44659b6d75522cc44b0c6