Skip to content

how to contribute testing

Douwe de Vries edited this page Jul 2, 2026 · 2 revisions

Testing

CSV Align has three main test surfaces: root Rust integration tests, Tauri wrapper tests, and frontend Vitest tests. CI also validates release metadata and Linux package metadata.

Rust integration tests

Top-level tests/*.rs exercise public backend behavior through the shared library and API surfaces.

Test area Example files
Comparison semantics tests/comparison_engine_integration.rs, tests/mapping_integration.rs, tests/nullish_key_handling_integration.rs
Backend workflows tests/backend_workflow_integration.rs, tests/session_store_integration.rs, tests/local_file_loading_integration.rs
Persistence tests/pair_order_persistence_integration.rs, tests/comparison_snapshot_persistence_integration.rs, tests/json_virtual_fields_persistence_integration.rs
API contracts tests/response_contracts.rs, tests/comparison_snapshot_router_integration.rs, tests/transport_parity_integration.rs
Packaging tests/linux_package_metadata_integration.rs, tests/release_metadata_script_integration.rs

Run them with cargo test from the repo root.

Tauri tests

src-tauri/src/tests.rs, src-tauri/src/pair_order_tests.rs, and src-tauri/src/comparison_snapshot_tests.rs cover desktop command behavior. CI creates placeholder frontend/dist/index.html before compiling wrapper tests because tauri::generate_context! needs a frontend path.

Run them with:

cd src-tauri
cargo test

Frontend tests

Frontend tests are colocated under frontend/src/ and use Vitest, React Testing Library, jsdom, and setup from frontend/src/test/setup.ts.

Area Example files
Workflow hooks frontend/src/hooks/useComparisonWorkflow.test.ts, frontend/src/hooks/useComparisonWorkflow.reducer.test.ts
App steps frontend/src/App.file-selection-navigation.test.tsx, frontend/src/App.results-navigation.test.tsx
Mapping UI frontend/src/components/MappingConfig.test.tsx, frontend/src/features/mapping/autoPair.test.ts
Results UI frontend/src/components/ResultsTable.test.tsx, frontend/src/features/results/presentation.test.ts
Transport frontend/src/services/tauri.test.ts, frontend/src/services/tauri.comparison-snapshot.test.ts

Run them with:

cd frontend
npm test

For validation commands, see getting started. For debugging failed tests, see debugging.

Clone this wiki locally