Commit 163dda35 authored by Mathias Chouet's avatar Mathias Chouet 🍝
Browse files

Add spec for PreBarrage links

parent 705b7cde
......@@ -640,5 +640,15 @@ describe("Class PreBarrage:", () => {
}).toThrowError("PreBarrage.checkGeometry(): basin 0 (starting at 0) must have at least one upstream wall (has 0) and one downstream wall (has 1)");
})
it("jalhyd#274", () => {
const sess = `{"header":{"source":"jalhyd","format_version":"1.3","created":"2020-09-23T13:06:04.234Z"},"settings":{"precision":1e-7,"maxIterations":100,"displayPrecision":3},"documentation":"","session":[{"uid":"b2xvMG","props":{"calcType":"PreBarrage"},"meta":{"title":"Prébarrages 1"},"children":[{"uid":"bW91cW","props":{"calcType":"PbBassin"},"children":[],"parameters":[{"symbol":"S","mode":"SINGLE","value":13.8},{"symbol":"ZF","mode":"SINGLE","value":95}]},{"uid":"eHhmc3","props":{"calcType":"PbBassin"},"children":[],"parameters":[{"symbol":"S","mode":"SINGLE","value":15.4},{"symbol":"ZF","mode":"SINGLE","value":95}]},{"uid":"anJiOX","props":{"calcType":"PbBassin"},"children":[],"parameters":[{"symbol":"S","mode":"SINGLE","value":16.2},{"symbol":"ZF","mode":"SINGLE","value":94.7}]},{"uid":"NmR4dT","props":{"calcType":"PbBassin"},"children":[],"parameters":[{"symbol":"S","mode":"SINGLE","value":17.5},{"symbol":"ZF","mode":"SINGLE","value":94.4}]},{"uid":"Zmp4OD","props":{"calcType":"PbBassin"},"children":[],"parameters":[{"symbol":"S","mode":"SINGLE","value":32.1},{"symbol":"ZF","mode":"SINGLE","value":94.25}]},{"uid":"OWZmeT","props":{"calcType":"PbBassin"},"children":[],"parameters":[{"symbol":"S","mode":"SINGLE","value":35},{"symbol":"ZF","mode":"SINGLE","value":94.1}]},{"uid":"OHQxMj","props":{"calcType":"PbCloison","upstreamBasin":"","downstreamBasin":"bW91cW"},"children":[{"uid":"dm81dm","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.3},{"symbol":"L","mode":"SINGLE","value":0.4},{"symbol":"CdCunge","mode":"SINGLE","value":1}]},{"uid":"ZDYxYn","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":96.25},{"symbol":"L","mode":"SINGLE","value":4.4},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"N21zZm","props":{"calcType":"PbCloison","upstreamBasin":"","downstreamBasin":"eHhmc3"},"children":[{"uid":"ZWNrb2","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":100},{"symbol":"L","mode":"SINGLE","value":1},{"symbol":"CdCunge","mode":"SINGLE","value":1}]},{"uid":"YXhnNX","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":96.25},{"symbol":"L","mode":"SINGLE","value":5},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"OHN0ND","props":{"calcType":"PbCloison","upstreamBasin":"","downstreamBasin":"Zmp4OD"},"children":[{"uid":"emI1az","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":96.25},{"symbol":"L","mode":"SINGLE","value":3.5},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"dnlmOT","props":{"calcType":"PbCloison","upstreamBasin":"","downstreamBasin":"OWZmeT"},"children":[{"uid":"aG1obT","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":96.25},{"symbol":"L","mode":"SINGLE","value":3.6},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"eXN4Zn","props":{"calcType":"PbCloison","upstreamBasin":"bW91cW","downstreamBasin":"anJiOX"},"children":[{"uid":"d2dhd2","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95},{"symbol":"L","mode":"SINGLE","value":0.4},{"symbol":"CdCunge","mode":"SINGLE","value":1}]},{"uid":"cW9kMG","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":96.25},{"symbol":"L","mode":"SINGLE","value":5.2},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"aGd3YT","props":{"calcType":"PbCloison","upstreamBasin":"eHhmc3","downstreamBasin":"anJiOX"},"children":[{"uid":"MTJ4c3","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.85},{"symbol":"L","mode":"SINGLE","value":4.38},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"NDJleW","props":{"calcType":"PbCloison","upstreamBasin":"eHhmc3","downstreamBasin":"NmR4dT"},"children":[{"uid":"c2VsY3","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.85},{"symbol":"L","mode":"SINGLE","value":3},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"ZzQ5dG","props":{"calcType":"PbCloison","upstreamBasin":"eHhmc3","downstreamBasin":"Zmp4OD"},"children":[{"uid":"dGFsY3","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.5},{"symbol":"L","mode":"SINGLE","value":1},{"symbol":"CdCunge","mode":"SINGLE","value":1}]},{"uid":"Nmtxcn","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.75},{"symbol":"L","mode":"SINGLE","value":3},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"MDFpaH","props":{"calcType":"PbCloison","upstreamBasin":"anJiOX","downstreamBasin":"NmR4dT"},"children":[{"uid":"YTVrNW","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":94.7},{"symbol":"L","mode":"SINGLE","value":0.4},{"symbol":"CdCunge","mode":"SINGLE","value":1}]},{"uid":"M3EyOG","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.65},{"symbol":"L","mode":"SINGLE","value":5.74},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"YnZwaD","props":{"calcType":"PbCloison","upstreamBasin":"NmR4dT","downstreamBasin":"Zmp4OD"},"children":[{"uid":"dWp1dn","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":94.4},{"symbol":"L","mode":"SINGLE","value":0.4},{"symbol":"CdCunge","mode":"SINGLE","value":1}]},{"uid":"ZnA3Z2","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.35},{"symbol":"L","mode":"SINGLE","value":6},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"OGd3cj","props":{"calcType":"PbCloison","upstreamBasin":"Zmp4OD","downstreamBasin":"OWZmeT"},"children":[{"uid":"cXdsbG","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":94.25},{"symbol":"L","mode":"SINGLE","value":0.7},{"symbol":"CdCunge","mode":"SINGLE","value":1}]},{"uid":"OHhvMG","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.05},{"symbol":"L","mode":"SINGLE","value":9.5},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"bmQ4eX","props":{"calcType":"PbCloison","upstreamBasin":"OWZmeT","downstreamBasin":""},"children":[{"uid":"cmdoNm","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":94.1},{"symbol":"L","mode":"SINGLE","value":0.95},{"symbol":"CdCunge","mode":"SINGLE","value":1}]},{"uid":"cDhhdm","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":94.75},{"symbol":"L","mode":"SINGLE","value":10.2},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]}],"parameters":[{"symbol":"Q","mode":"CALCUL","value":0.844},{"symbol":"Z1","mode":"SINGLE","value":101},{"symbol":"Z2","mode":"SINGLE","value":94.45}]},{"uid":"aHZxan","props":{"calcType":"SectionParametree"},"meta":{"title":"Sec. param."},"children":[{"uid":"NDc4Ym","props":{"calcType":"Section","nodeType":"SectionRectangle"},"children":[],"parameters":[{"symbol":"Ks","mode":"SINGLE","value":40},{"symbol":"Q","mode":"LINK","targetNub":"b2xvMG","targetParam":"Q"},{"symbol":"If","mode":"SINGLE","value":0.001},{"symbol":"YB","mode":"SINGLE","value":1},{"symbol":"Y","mode":"SINGLE","value":0.8},{"symbol":"LargeurBerge","mode":"SINGLE","value":2.5}]}],"parameters":[]}]}`;
Session.getInstance().clear();
Session.getInstance().unserialise(sess);
const sp = Session.getInstance().findNubByUid("aHZxan") as SectionParametree;
expect(() => {
sp.CalcSerie();
}).not.toThrow();
});
})
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment