diff --git a/spec/param/param_modes.spec.ts b/spec/param/param_modes.spec.ts index 0b6d2570a0607ed73552e3d6c054159508dcb269..b01100c4958989eab2f3aa0e6c5e052771d29d89 100644 --- a/spec/param/param_modes.spec.ts +++ b/spec/param/param_modes.spec.ts @@ -317,3 +317,34 @@ describe("cohérence des modes de paramètres : ", () => { } }); }); + +describe("Structure and calculated parameter(s) : ", () => { + it ("when all other params are linked, changing Structure should not lead to > 1 param. in CALC mode", () => { + const pc1 = new CloisonsParams(1.5, 102, 10, 1, 1, 0.5); + const c1 = new Cloisons(pc1); + c1.addChild(CreateStructure(LoiDebit.OrificeSubmerged, c1)); + + const pc2 = new CloisonsParams(1.5, 102, 10, 1, 1, 0.5); + const c2 = new Cloisons(pc2); + const c2s1 = CreateStructure(LoiDebit.OrificeSubmerged, c2); + c2.addChild(c2s1); + + Session.getInstance().clear(); + Session.getInstance().registerNub(c1); + Session.getInstance().registerNub(c2); + + pc2.Q.defineReference(c1, "Q"); + pc2.Z1.defineReference(c1, "Z1"); + pc2.LB.defineReference(c1, "LB"); + pc2.BB.defineReference(c1, "BB"); + pc2.PB.defineReference(c1, "PB"); + pc2.DH.defineReference(c1, "DH"); + + checkConsistency(c2); + + const c2s2 = CreateStructure(LoiDebit.KIVI, c2); + c2.replaceChildInplace(c2s1, c2s2); + + checkConsistency(c2); + }); +});