♻️ refactor(test): coverage tooling — phases 0-5 of 80% coverage roadmap - #4678
Draft
riccio82 wants to merge 39 commits into
Draft
♻️ refactor(test): coverage tooling — phases 0-5 of 80% coverage roadmap#4678riccio82 wants to merge 39 commits into
riccio82 wants to merge 39 commits into
Conversation
riccio82
force-pushed
the
coverage-improvement-plan
branch
from
July 14, 2026 13:10
a8ab66d to
47134be
Compare
…nt-plan # Conflicts: # vite.config.js
Previous fixture happened to already sit in descending order, so a broken (no-op or sign-flipped) comparator produced the same output as the correct one, masking the assertion. Reorder the fixture so the correct descending sort actually changes element order.
Mock useSocketLayer to capture the eventHandlers map SocketListener builds, then invoke disconnected/reconnected/force_reload/quota_exceeded/concordance/ logout/ack directly and assert on the resulting action calls. Raises public/js/sse/ coverage threshold from 0 to 29 (actual: 29.62% lines).
…ation paths Add unit tests for segmentTranslation's offline-queue branch, the fuzzy-match and propagation confirmation modals, execSetTranslationTail's success/error paths, and the propagation notification branches. Raises the file's coverage threshold from 5% to 95% (actual: 97.74% lines / 85.58% branches).
…ertion The "locked segments have been excluded" regex is a substring of the not_ice branch's "non-locked segments have been excluded" text, so it passed regardless of which branch ran. Add a negative assertion ruling out the non-ice phrasing to genuinely prove the ice branch executed.
…ect and TmGlossarySelect
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 34906997 | Triggered | Generic Password | 2ba2cbc | public/js/components/onBoarding/Register.test.js | View secret |
| 35024100 | Triggered | Generic Password | 43f2cf0 | public/js/components/outsource/AssignToTranslator.test.js | View secret |
| 35024102 | Triggered | Generic Password | 43f2cf0 | public/js/components/outsource/AssignToTranslator.test.js | View secret |
| 35024101 | Triggered | Generic Password | 43f2cf0 | public/js/components/projects/ChunksJobContainer.test.js | View secret |
| 35039354 | Triggered | Generic Password | 4306a72 | public/js/components/analyze/ProjectAnalyze.test.js | View secret |
| 35065435 | Triggered | Generic Password | 5f1762a | public/js/stores/ProjectsStore.test.js | View secret |
| 35065435 | Triggered | Generic Password | 5f1762a | public/js/stores/ProjectsStore.test.js | View secret |
| 35065434 | Triggered | Generic Password | 5f1762a | public/js/stores/ProjectsStore.test.js | View secret |
| 35065435 | Triggered | Generic Password | 5f1762a | public/js/stores/ProjectsStore.test.js | View secret |
| 35065436 | Triggered | Generic Password | 5f1762a | public/js/stores/ProjectsStore.test.js | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
… to 80% Add unit/RTL tests for the outsource flow (AssignToTranslator, OutsourceVendor, OutsourceContainer and children), the projects bulk-actions flow (ProjectsBulkActions and its Bulk* modals), and shared common UI primitives (Dropdown, Accordion, NumericStepper, ApplicationWrapper, form rule helpers, etc.), completing Phase 3 of the coverage improvement plan. Coverage: outsource 8.3% -> 98.8%, projects 52.1% -> 84.8%, common 61.5% -> 81.0%.
…hase 3 Follow-up to the previous commit: `git commit -a` only stages tracked-file changes, so these newly-added test files (untracked) were missed from that commit. No further logic changes, same phase 3 coverage work.
…o 80% Add unit/RTL tests for the analysis flow (AnalyzeMain, ProjectAnalyze, AnalyzeChunksResume, AnalyzeHeader and the chunk/job analyze sub-components) and the review-extended (LQA) flow (ReviewExtendedIssue, ReviewExtendedIssuePanel, ReviewExtendedCategorySelector, ReviewExtendedIssuesContainer and related sub-components), completing Phase 4 of the coverage improvement plan. Coverage: analyze 0% -> 94.9%, review_extended 9.3% -> 94.0%.
…gn merge SocialButtons.js switched from <img alt="..."> to inline SVG icon components with no accessible name, so alt-text queries no longer match. Query by DOM position/container scope instead, matching the rendered structure.
Add unit tests for custom hooks (useAuth, useOutsourceQuote, useSocketLayer, useMediaQuery, useResizable, useCurrencyRates, useResizeObserver, useDeviceCompatibility, UseHotKeysComponent, useContextDocument) and modal components (SplitJob, PreferencesModal, ModifyTeam, JobMetadataModal, ShareTmModal, ShortCutsModal, RevisionFeedbackModal, CreateTeam, CopySourceModal, and smaller confirm/alert modals plus the shared ModalContainer/ModalOverlay/modalRegistry plumbing), completing Phase 5 of the coverage improvement plan. Coverage: hooks 44.4% -> 98.1%, modals 10.0% -> 95.6%.
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
Multi-phase initiative to raise
public/jsline coverage from ~27% to an 80% floor, enforcedper-directory via Jest
coverageThresholdso it can never regress. Full roadmap is a local planning doc(
docs/superpowers/plans/, gitignored in this repo, not part of this diff).Progress so far:
per-directory
coverageThresholdfloored at each directory's measured coverage onupdate-design.footer,review,quality_report,globalFunctions.js,contextPreview,activityLog,sse(partial, 29%, byexplicit budget),
xliffToTarget(partial, 72%, by explicit budget),setTranslationUtil.js(95%),notificationsComponent.onBoarding,createProject,languageSelector, all raised to an 80% linefloor. Covers SocialButtons, Login, ForgotPassword, PasswordReset, Register, the OnBoarding
step-routing wrapper, SourceLanguageSelect/TargetLanguagesSelect/TmGlossarySelect/UploadFile,
HomePageSection,
useFileUploadManager/GDrive upload hooks, and LanguageSelector/LanguageSelectorSearch/LanguageSelectorList.
outsource,projects,common, all raised to an 80% line floor. Coveragereached:
outsource8.3%→98.8%,projects52.1%→84.8%,common61.5%→81.0%. Covers the outsourcequote/assignment flow (AssignToTranslator, OutsourceVendor, OutsourceContainer and children), the
projects bulk-actions flow (ProjectsBulkActions and its Bulk* modals), and shared common UI primitives
(Dropdown, Accordion, NumericStepper, ApplicationWrapper, form rule helpers, etc.).
analyze,review_extended, both raised to an 80% line floor. Coveragereached:
analyze0%→94.9%,review_extended9.3%→94.0%. Covers the analysis flow (AnalyzeMain,ProjectAnalyze, AnalyzeChunksResume, AnalyzeHeader and chunk/job analyze sub-components) and the
review-extended (LQA) flow (ReviewExtendedIssue, ReviewExtendedIssuePanel,
ReviewExtendedCategorySelector, ReviewExtendedIssuesContainer and related sub-components).
hooks,modals, both raised to an 80% line floor. Coverage reached:hooks44.4%→98.1%,
modals10.0%→95.6%. Covers custom hooks (useAuth, useOutsourceQuote, useSocketLayer,useMediaQuery, useResizable, useCurrencyRates, useResizeObserver, useDeviceCompatibility,
UseHotKeysComponent, useContextDocument) and modal components (SplitJob, PreferencesModal, ModifyTeam,
JobMetadataModal, ShareTmModal, ShortCutsModal, RevisionFeedbackModal, CreateTeam, CopySourceModal, and
the smaller confirm/alert modals plus the shared ModalContainer/ModalOverlay/modalRegistry plumbing).
Remaining roadmap: Phase 6 (
actions,stores), Phase 7 (pages,utils), Phase 8 (header,api),Phase 9 (
settingsPanel), Phase 10 (segments, split into sub-phases).Type
feat— new user-facing featurefix— bug fixrefactor— restructure without behavior changechore— build, deps, config, docsperf— performance improvementtest— test coverageChanges
jest.config.js**/index.js,components/icons/**,img/icons/**fromcollectCoverageFromjest.config.jscoverageThresholdratchet — raised as each phase's tests land (see Summary)public/js/components/footer/**,review/**,quality_report/**,globalFunctions.js,contextPreview/**,activityLog/**,sse/**,xliffToTarget/**,setTranslationUtil.js,notificationsComponent/**public/js/components/onBoarding/**,createProject/**,languageSelector/**public/js/components/outsource/**,projects/**,common/**public/js/components/analyze/**,review_extended/**public/js/hooks/**,components/modals/**Migration Notes
N/A — no database migrations in this PR.
Testing
vendor/bin/phpunit --exclude-group=ExternalServices --no-coveragepasses./vendor/bin/phpstanpasses (0 errors, with baseline)yarn jest --watchAll=false --coveragepasses with no threshold failures: 189 of 191 suites (2pre-existing skips), 1733/1749 tests passing (16 pre-existing skips, unrelated to this change), exit
code 0.
AI Disclosure
Claude Code (Sonnet 5), used throughout to plan phases, implement tests via a subagent-drafted /
independently-verified workflow (dispatched agents draft and run tests, then their work is independently
re-verified against the real source and the full test suite before committing), and verify coverage/
threshold changes. Reviewed by the requester before merge.
Notes
Base branch is
update-design(#4307), notdevelop, since that PR rewrites ~294 JS files and buildingcoverage against
developwould discard most of that work. This branch is kept current with both linesof development via periodic merges. No CI workflow changes are needed since the existing JS test step
already fails the build on a non-zero Jest exit code, which
coverageThresholdfailures now trigger.This PR will continue to accumulate commits as later phases land — expect further pushes to this same
branch/PR rather than new PRs per phase.