Skip to content

Fix/frontend quality - #3

Open
Anubhutisharma-07 wants to merge 826 commits into
mainfrom
fix/frontend-quality-round6
Open

Fix/frontend quality #3
Anubhutisharma-07 wants to merge 826 commits into
mainfrom
fix/frontend-quality-round6

Conversation

@Anubhutisharma-07

Copy link
Copy Markdown
Owner

Summary

This PR completes the frontend automated test coverage across the service and reusable component layers.

It brings all 65+ services under src/services/ under automated test coverage and adds dedicated tests for important shared UI components.

The tests use Vitest and MSW to verify both successful API behavior and error/fallback paths.

Coverage Added

Services

25 test files now cover every service in src/services/.

Coverage includes:

  • Biomedical services
  • Clinical services
  • Security services
  • Compliance services
  • Authentication and authorization
  • Zero-trust infrastructure
  • Quantum/security services
  • Procurement and equipment services
  • Analytics and governance
  • Healthcare infrastructure
  • Monitoring and telemetry

Each service is tested for its relevant happy paths, API responses, fallback behavior, and edge cases.

Components

Dedicated component coverage was added for:

  • ErrorBoundary

    • Error catching
    • Navigation behavior
    • MedTrack route handling
  • LoadingSpinner

    • Rendering
    • Props
  • SkeletonLoader

    • Rendering
    • Props
  • Pagination

    • Page buttons
    • Disabled states
    • Current-page highlighting
  • MedTrackLogo

    • Rendering
    • Props
  • ScrollToTopButton

    • Visibility behavior
    • Scroll handling
  • AnimatedSection

    • Opacity
    • Animation behavior
    • Delay handling
  • CookieBanner

    • Show/hide behavior
    • localStorage handling
    • Accept/Decline actions
  • PriceFilterPresetGroup

    • Rendering
    • Preset selection
    • Active state

Pre-existing Test Fixes

The branch also repairs five existing test failures:

  1. Dashboard

    • Replaced ambiguous getByText(/MedTrack/i) query with a specific heading query.
  2. EquipmentCalibrationHub

    • Replaced an ambiguous text query with an explicit button-role query.
  3. LoginPage

    • Replaced incorrect getByDisplayValue() usage with combobox/option assertions.
  4. AppRoutes

    • Increased timeout for lazy-loaded route assertions.
  5. HttpService

    • Removed the problematic global location stub that interfered with MSW URL resolution.

These changes repair stale or incorrect tests without changing the intended application behavior.

Final Statistics

  • Total test files: 28
  • Total test code: 2,965 lines
  • Services covered: ALL 65+ services
  • Components covered: 9
  • Pre-existing test failures repaired: 5

Commits

  • 0874a034
  • 542a2f34

Branch:

fix/frontend-quality-round6

Verification

The branch contains the complete service and component test coverage.

The final verification should include:

  • Full Vitest suite
  • Component test execution
  • Service test execution
  • Coverage report generation

Follow-up

Potential next steps:

  • Add page-level integration tests for critical user workflows.
  • Add E2E coverage for authentication, procurement, hospital operations, and security workflows.
  • Generate and review the frontend coverage report.
  • Identify remaining low-coverage branches and add targeted edge-case tests.

PR

main...fix/frontend-quality-round6

Kanam Ramu added 30 commits August 16, 2026 22:51
…-duplicate-declarations

fix(routes): restore the production build and register nine orphaned consoles
…dary-validation-1228

feat: add geolocation boundary validation
…ipment-exports-1224

perf: stream large equipment exports
…i-throttling-1227

feat: Implement Rate Limiting and API Throttling
…ical-entities-1226

feat: implement soft deletion for User and Hospital
…ndling-1225

feat: standardize API error handling with RFC 7807 Problem Details (#…
…-primitives

refactor(frontend): extract shared playback, toast and series helpers
…ge-refactor

refactor(frontend): extract shared hub UI primitives + fix route regi…
…-primitives

refactor(frontend): extract shared Modal/InfoRow primitives + registr…
…-primitives

refactor(frontend): extract shared TabsBar, SimControls and EmptyState
…-primitives

refactor(frontend): extract shared SearchBox, SeverityChips and Filte…
…atient-ehr-analytics-hub

feat(patient): implement Patient EHR Telemetry Analytics & Chronic Disease Predictive Engine (kRamu81#1252)
…iomedical-ai-diagnostics-hub

feat(ai): implement Biomedical AI Diagnostics Overwatch Command Center (kRamu81#1250)
…uth-security-infrastructure-hub

feat(auth): implement Backend Authentication Security Infrastructure Hub & ZeroTrust Service (kRamu81#1248)
…nterprise-zerotrust-security-governance-hub

feat(frontend): implement Enterprise Zero-Trust Security & Governance Hub (kRamu81#1246)
…cu-telemetry-overwatch-hub

feat(frontend): implement Real-Time Telemetry & ICU Critical Care Overwatch Hub (kRamu81#1244)
…ology-infusion-hub

feat(frontend): implement Oncology Infusion Center Hub (kRamu81#1240)
…diology-cathlab-hub

feat(frontend): implement Cardiology & Cath Lab Hub (kRamu81#1238)
…hology-hub

feat(frontend): implement Pathology & Digital Pathology Hub (kRamu81#1236)
dipanshubatra and others added 7 commits August 19, 2026 20:29
…existing test failures

Adds comprehensive test suites for 13 previously untested services:
- IncidentResponsePlaybookService (8 tests)
- HipaaDeidentificationService (7 tests)
- PasskeyPasswordlessService (10 tests)
- IotSecurityService (7 tests)
- AiModelGovernanceService (7 tests)
- ThreatIntelService (7 tests)
- RpmTelemetryService (7 tests)
- PamSessionService (7 tests)
- Fido2WebAuthnService (7 tests)
- QkdKeyDistributionService (7 tests)
- PostQuantumCryptoService (7 tests)
- HealthcareCtemService (7 tests)
- CspmService (8 tests)

Also fixes 5 pre-existing broken test queries:
- Dashboard.test.jsx: ambiguous getByText → getByRole('heading')
- EquipmentCalibrationHub.test.jsx: ambiguous getByText → getByRole('button')
- LoginPage.test.jsx: getByDisplayValue → getByRole('combobox'/'option')
- AppRoutes.test.jsx: lazy-loading timeouts → increased findAllByText timeout
- HttpService.test.jsx: broken vi.stubGlobal("location") → fixed teardown

Co-Authored-By: Codebuff <noreply@codebuff.com>
…+ services)

Adds test coverage for every remaining service in the codebase:

- AnalyticsService, ComplianceReportingService, SecurityPostureService
- OrderService, ProcurementService (full CRUD + approval workflows)
- EquipmentService, MaintenanceService, EventStreamService
- ThreatDetectionService, SbomService, SiemSecurityAnalyticsService, KeyVaultSecurityService
- ZeroTrustNetworkService, ZeroTrustGovernanceService, DlpPrivacyGuardService, GrcAuditComplianceService
- MfaService, SsoSecurityService, RbacSecurityService, ComplianceSecurityService, SecurityGovernanceService
- SoarService, SecurityPlaybookService, SecurityKeyVaultService, SecurityObservabilityService, SecurityCommandCenterService
- SecurityThreatService, SecurityVulnerabilityService, ZeroTrustSdpService, ZeroTrustSecurityService, MicrosegmentationService
- HealthcareCspmService, SamlIdentityProviderService, ScimProvisioningService
- ClinicalAiDefenseService, ClinicalTrialLedgerService, GenomicDataVaultService, HomomorphicEncryptionService
- VulnerabilityManagementService

Total: ~60+ services now have test coverage.

Co-Authored-By: Codebuff <noreply@codebuff.com>
Component tests (3 new files):
- ErrorBoundary: error catching, children, Go Home navigation, MedTrack path
- LoadingSpinner: default/custom text, spinner animation
- SkeletonLoader: default/custom rows, className
- Pagination: page buttons, prev/next disable, current page highlight
- MedTrackLogo: rendering, size/className props
- ScrollToTopButton: visibility on scroll, scroll-to-top behavior
- AnimatedSection: opacity, animation, delay, className props
- CookieBanner: show/hide, Accept All, Decline Optional, localStorage
- PriceFilterPresetGroup: rendering, click, active highlight

Service tests (2 new files):
- ApiGatewaySecurityService: routes, onboard, OWASP audit
- AuthService: register, login, forgot password, OTP, reset, authority version
- FhirEhrSecurityService: resources, register, SMART on FHIR scopes
- PamService: policy, requests, approval, session logs
- BiomedicalAiWatermarkService: datasets, watermark, C2PA verify
- BiomedicalBlockchainService: blocks, mining, ZKP verify
- BiomedicalDataMeshService: domains, onboard, policy eval
- BiomedicalIncidentCommandService: incidents, failover, airgap restore
- BiomedicalMpcHsmService: vaults, MPC threshold sign
- BiomedicalSoarService: playbooks, deploy, simulation
- BiomedicalSovereignIdentityService: DID/VC, issue, ZKP verify
- ComplianceEvidenceService: policy, ingest, chain verify
- ThreatIntelligenceService: feed config, IOC ingest, mitigation

Co-Authored-By: Codebuff <noreply@codebuff.com>
@github-actions github-actions Bot added the ECSoC26 ECSoC 2026 Initiative label Aug 19, 2026
@github-actions github-actions Bot added the frontend Frontend related changes label Aug 19, 2026
Kanam Ramu added 19 commits August 20, 2026 08:12
…-cardiovascular-hemodynamics-hub

feat(hemodynamics): implement Cardiovascular Hemodynamics & Advanced Circulatory Support Command Station (kRamu81#1439)
…-nephrology-crrt-hub

feat(nephrology): implement Nephrology CRRT & Renal Replacement Therapy Command Station (kRamu81#1441)
…-oncology-precision-oncology-hub

feat(oncology): implement Precision Oncology & Molecular Tumor Board Command Station (kRamu81#1443)
…-picu-critical-telemetry-hub

feat(picu): implement Pediatric ICU Telemetry & Advanced Neuro-Resuscitation Command Station (kRamu81#1445)
…-bioai-diagnostics-hub

feat(bioai): implement Bio-AI Diagnostics & Explainable Multi-Modal Clinical Intelligence Command Station (kRamu81#1447)
…erotrust-biomedical-security-hub

feat(security): implement Zero-Trust Biomedical Security Command Station (kRamu81#1506)
…emodynamics-cardiovascular-overwatch-hub

feat(cardiovascular): implement Cardiovascular Hemodynamics Command Station (kRamu81#1504)
…io-ai-diagnostics-genomic-analytics-hub

feat(bioai): implement Bio-AI Diagnostics Command Station (kRamu81#1502)
…euro-icu-intracranial-pressure-hub

feat(neuro): implement Neuro ICU Intracranial Pressure Command Station (kRamu81#1498)
…isaster-triage-incident-command-hub

feat(triage): implement Emergency Disaster Triage Command Station (kRamu81#1500)
…uality-round5

test: add comprehensive service tests + fix 5 pre-existing test failures
@github-actions github-actions Bot added the backend Backend related changes label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend related changes ECSoC26 ECSoC 2026 Initiative frontend Frontend related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants