Description
Of 34 Rust modules, 9 have no #[cfg(test)] block at all. The highest-risk gap is employees.rs — the most-written-to table, with a non-trivial dynamic WHERE clause builder (build_employee_filter at employees.rs:183-215). An off-by-one in condition joining silently returns wrong data.
Current State
Untested modules (grep confirms no #[cfg(test)]):
src-tauri/src/employees.rs ⚠️ (riskiest — dynamic SQL builder)
src-tauri/src/enps.rs
src-tauri/src/review_cycles.rs
src-tauri/src/performance_ratings.rs
src-tauri/src/company.rs
src-tauri/src/settings.rs
src-tauri/src/provider.rs
src-tauri/src/network.rs
src-tauri/src/device_id.rs
Current: 382 passing tests, primarily concentrated in context.rs, chat.rs, pii.rs, data_quality.rs, memory.rs, highlights.rs.
Suggested Fix
Prioritize by risk:
Verification
Automation Hints
scope: src-tauri/src/{employees,enps,review_cycles,performance_ratings,company,settings,provider}.rs
do-not-touch: existing tests
approach: add-declarations
risk: low
max-files-changed: 7
blocked-by: none
bail-if: none
Priority
Medium — prevents silent regressions in the most-used paths.
Description
Of 34 Rust modules, 9 have no
#[cfg(test)]block at all. The highest-risk gap isemployees.rs— the most-written-to table, with a non-trivial dynamic WHERE clause builder (build_employee_filteratemployees.rs:183-215). An off-by-one in condition joining silently returns wrong data.Current State
Untested modules (grep confirms no
#[cfg(test)]):src-tauri/src/employees.rssrc-tauri/src/enps.rssrc-tauri/src/review_cycles.rssrc-tauri/src/performance_ratings.rssrc-tauri/src/company.rssrc-tauri/src/settings.rssrc-tauri/src/provider.rssrc-tauri/src/network.rssrc-tauri/src/device_id.rsCurrent: 382 passing tests, primarily concentrated in context.rs, chat.rs, pii.rs, data_quality.rs, memory.rs, highlights.rs.
Suggested Fix
Prioritize by risk:
employees.rs::build_employee_filter— minimum: empty filter, single condition, multi-condition (AND join), edge values.provider.rs— factory test (resolves correct provider for each id).enps.rs,review_cycles.rs,performance_ratings.rs— basic CRUD + a query-edge-case test each.company.rs,settings.rs— upsert semantics.network.rs,device_id.rs— probably not worth extensive unit testing; document rationale if skipped.Verification
cargo test --manifest-path src-tauri/Cargo.tomlpasses with >420 tests (current 382 + at least 40 new).src-tauri/src/has either a#[cfg(test)]block or a brief code comment explaining why no unit tests (e.g., "integration-test only").Automation Hints
scope: src-tauri/src/{employees,enps,review_cycles,performance_ratings,company,settings,provider}.rs
do-not-touch: existing tests
approach: add-declarations
risk: low
max-files-changed: 7
blocked-by: none
bail-if: none
Priority
Medium — prevents silent regressions in the most-used paths.