fix: normalize engineering checks across units

Convert pump-depth vs rod-length mismatch gating to meter-equivalent comparisons, add imperial coverage, and correct rod material mapping with exported helper tests while refreshing related GUI/docs copy.

Made-with: Cursor
This commit is contained in:
2026-04-16 23:28:00 -06:00
parent 64e9d31373
commit 2a6cee21f8
8 changed files with 73 additions and 19 deletions

View File

@@ -0,0 +1,26 @@
import { describe, expect, it } from "vitest";
import { rodTypeToProps } from "../src/solverClient.js";
describe("solverClient rod type mapping", () => {
it("maps fiberglass rod type 3 to fiberglass properties", () => {
expect(rodTypeToProps(3)).toEqual({
E: 5.5e9,
rho: 1900
});
});
it("maps sinker and steel rod types to steel-like properties", () => {
expect(rodTypeToProps(2)).toEqual({
E: 2.05e11,
rho: 7850
});
expect(rodTypeToProps(0)).toEqual({
E: 2.05e11,
rho: 7850
});
expect(rodTypeToProps(1)).toEqual({
E: 2.05e11,
rho: 7850
});
});
});