Repository navigation
Add comprehensive test suites for backend and frontend - #25
Merged
Merged
Conversation
Backend (pytest, 80 tests): - test_sanitize.py: sanitize_for_json with NumPy types, nested structures, edge cases - test_compute_deltas.py: flow delta computation, threshold categorization, direction logic - test_network_service.py: NetworkService load/query with mocked pypowsybl - test_api_endpoints.py: all FastAPI endpoints via TestClient with mocked services - conftest.py: module-level mocks for domain packages (pypowsybl, expert_op4grid_recommender) Frontend (vitest + testing-library, 66 tests): - svgUtils.test.ts: processSvg, boostSvgForLargeGrid, buildMetadataIndex, getActionTargetLines, getActionTargetVoltageLevel - OverloadPanel.test.tsx: rendering, click callbacks, overload display - VisualizationPanel.test.tsx: tab rendering, loading states, zoom controls, view mode toggle, convergence warnings - api.test.ts: all API client methods, NDJSON streaming parser, error handling https://claude.ai/code/session_011cg6PjoX5hfQ1yNWRfmpv7
marota
pushed a commit
that referenced
this pull request
Apr 30, 2026
Rewrites Phase 1 from the abstract CHANGELOG summary into a six-week chronology grounded in PR descriptions: - 1.1 Bootstrap (pre-#1) — scaffolding pushed direct to main - 1.2 End-to-end loop (PRs #1–#15) — NAD scaling, multi-tab pan/zoom, manual actions, action variants, action scoring, svgUtils + usePanZoom - 1.3 UX maturation (PRs #16–#24) — settings panel, OverloadPanel, monitoring factor, action filters, state-switching SLDs - 1.4 Robustness + CI (PRs #25–#46) — backend/frontend test suites, CircleCI + GitHub Actions, lazy loading, divergence UI - 1.5 Persistence + complex actions (PRs #47–#56) — save/reload sessions, combined actions w/ persistence, islanding MW, App.tsx Phase 1 hooks - 1.6 Two-step + replay logging + rebrand (PRs #57–#65) — split analysis, config.json persistence, load shedding, MW Start, SLD highlights, InteractionLogger, ExpertAssist → Co-Study4Grid Sections 2–4 left untouched (will be reconciled in a follow-up). https://claude.ai/code/session_01Pg7fuCUG2edfm5PyHS6SbN
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
This PR adds extensive test coverage for both the backend FastAPI application and frontend React components, along with necessary test infrastructure and configuration.
Key Changes
Backend Testing
API Endpoint Tests (
test_api_endpoints.py): Comprehensive test suite for all FastAPI endpoints usingTestClientwith mocked services, covering:Network Service Tests (
test_network_service.py): Tests for network loading and querying:.xiidmand.xmlsupportRecommender Service Tests (
test_compute_deltas.py): Tests for flow delta computation:Utility Tests (
test_sanitize.py): Tests for JSON sanitization utility:Test Infrastructure (
conftest.py): Shared pytest fixtures and mocking:Frontend Testing
API Client Tests (
api.test.ts): Tests for axios-based API client:SVG Utilities Tests (
svgUtils.test.ts): Tests for SVG processing:Component Tests:
VisualizationPanel.test.tsx: Tab switching, diagram loading, zoom controlsOverloadPanel.test.tsx: Overload display and asset click handlingConfiguration
testandtest:watchscriptsNotable Implementation Details
unittest.mockto patch singleton services before app import, ensuring clean test isolationsys.modulesbefore production imports to handle unavailable domain packages in CI environmentshttps://claude.ai/code/session_011cg6PjoX5hfQ1yNWRfmpv7