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:
26
solver-api/tests/solverClient.test.js
Normal file
26
solver-api/tests/solverClient.test.js
Normal 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
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user