Summary
The project's test suite consists of a single file containing one assertion: expect(true).toBe(true). No business logic, no Edge Function behavior, no data model, no component, and no utility function is tested. The test suite is a placeholder that was never replaced with real tests.
Evidence
src/test/example.test.ts (the entire test file):
import { describe, it, expect } from "vitest";
describe("example", () => {
it("should pass", () => {
expect(true).toBe(true);
});
});
src/test/setup.ts contains only the jsdom setup boilerplate. There are no other test files in the project.
package.json defines "test": "vitest run" — running npm test produces 1 passing test that asserts a tautology. CI (if any) would show a green check that means nothing.
Functions with zero test coverage include:
- All 8 Edge Functions (TypeScript/Deno)
src/integrations/supabase/client.ts — Supabase client initialization
src/data/fields.ts — data model and helper functions (haToAcres)
src/lib/utils.ts — utility functions
- All React components
soil-data's classification logic (classifySoil, usdaTexture, phRating)
Why this matters
- No regression safety net: Any change to the GEE expression builders, soil classification logic, or data transformations can silently break production behavior with zero test failure.
- False CI confidence: If CI runs
npm test, it reports green. A reviewer or automated tool that checks "are tests passing?" will incorrectly conclude the codebase is tested.
- Classification correctness unverified:
classifySoil uses several overlapping numerical thresholds for soil type classification. Without tests, it is impossible to verify that the correct soil type is returned for boundary values, or that the USDA texture triangle logic (usdaTexture) correctly classifies soil fractions.
haToAcres conversion factor untested: The conversion function Math.round(ha * 2.47105 * 10) / 10 has rounding behavior that affects displayed field sizes; this is not tested.
Root cause
The project was scaffolded by Lovable with a placeholder test file that was never developed. The vitest.config.ts is correctly configured; the tooling is in place, but no actual tests were written.
Recommended fix
Replace the placeholder with meaningful tests, prioritizing correctness-critical pure functions first:
1. Soil classification (pure functions, easiest to test):
// src/test/soil-classification.test.ts
import { describe, it, expect } from "vitest";
// import classifySoil, usdaTexture etc. from the shared module once extracted
describe("usdaTexture", () => {
it("returns Clay when clay >= 40%", () => { ... });
it("returns Sand when sand >= 85%", () => { ... });
it("handles null inputs", () => { ... });
});
2. haToAcres conversion:
it("converts 1 hectare to 2.5 acres (rounded)", () => {
expect(haToAcres(1)).toBe(2.5);
});
3. Edge Function input validation (once extracted to shared module):
it("rejects polygons with < 4 vertices", () => { ... });
it("rejects coordinates outside [-180,180]", () => { ... });
Acceptance criteria
Suggested labels
bug
Priority
P3
Severity
Low — not a security issue, but a correctness and maintenance risk. Classification bugs will reach users silently.
Confidence
Confirmed — src/test/example.test.ts is the only test file in the repository.
Summary
The project's test suite consists of a single file containing one assertion:
expect(true).toBe(true). No business logic, no Edge Function behavior, no data model, no component, and no utility function is tested. The test suite is a placeholder that was never replaced with real tests.Evidence
src/test/example.test.ts(the entire test file):src/test/setup.tscontains only the jsdom setup boilerplate. There are no other test files in the project.package.jsondefines"test": "vitest run"— runningnpm testproduces 1 passing test that asserts a tautology. CI (if any) would show a green check that means nothing.Functions with zero test coverage include:
src/integrations/supabase/client.ts— Supabase client initializationsrc/data/fields.ts— data model and helper functions (haToAcres)src/lib/utils.ts— utility functionssoil-data's classification logic (classifySoil,usdaTexture,phRating)Why this matters
npm test, it reports green. A reviewer or automated tool that checks "are tests passing?" will incorrectly conclude the codebase is tested.classifySoiluses several overlapping numerical thresholds for soil type classification. Without tests, it is impossible to verify that the correct soil type is returned for boundary values, or that the USDA texture triangle logic (usdaTexture) correctly classifies soil fractions.haToAcresconversion factor untested: The conversion functionMath.round(ha * 2.47105 * 10) / 10has rounding behavior that affects displayed field sizes; this is not tested.Root cause
The project was scaffolded by Lovable with a placeholder test file that was never developed. The
vitest.config.tsis correctly configured; the tooling is in place, but no actual tests were written.Recommended fix
Replace the placeholder with meaningful tests, prioritizing correctness-critical pure functions first:
1. Soil classification (pure functions, easiest to test):
2.
haToAcresconversion:3. Edge Function input validation (once extracted to shared module):
Acceptance criteria
npm testruns more than one tautological assertionclassifySoilandusdaTexturehave test coverage for at least the main brancheshaToAcresis tested with known valuesexpect(true).toBe(true)test is removed or replacedSuggested labels
bug
Priority
P3
Severity
Low — not a security issue, but a correctness and maintenance risk. Classification bugs will reach users silently.
Confidence
Confirmed —
src/test/example.test.tsis the only test file in the repository.