Commit 6cc5b77e authored by Mathias Chouet's avatar Mathias Chouet 🍝
Browse files

Résolution bug parent des paramètres

mise à jour des tests liés
parent 6ca25a4f
......@@ -70,9 +70,9 @@ and then :
constructor(rL: number, rW: number, rA:number=undefined) {
super();
this._L = new ParamDefinition(ComputeNodeType.LechaptCalmon, 'L', ParamDomainValue.POS, rL);
this._W = new ParamDefinition(ComputeNodeType.LechaptCalmon, 'W', ParamDomainValue.POS, rW);
this._A = new ParamDefinition(ComputeNodeType.LechaptCalmon, 'A', ParamDomainValue.POS, rA);
this._L = new ParamDefinition(this, ComputeNodeType.LechaptCalmon, 'L', ParamDomainValue.POS, rL);
this._W = new ParamDefinition(this, ComputeNodeType.LechaptCalmon, 'W', ParamDomainValue.POS, rW);
this._A = new ParamDefinition(this, ComputeNodeType.LechaptCalmon, 'A', ParamDomainValue.POS, rA);
this.addParamDefinition(this._L);
this.addParamDefinition(this._W);
......
......@@ -11,7 +11,6 @@ describe("ngHyd − start page", () => {
it("when app starts, user should be redirected to /list page", async () => {
await page.navigateTo();
const url = await browser.driver.getCurrentUrl(); // @TODO move brower related stuff to .po ?
console.log("URL", url);
expect(url).toContain("/list");
});
......
......@@ -14,13 +14,13 @@ describe("ngHyd − create calculators and navigate among them", () => {
});
it("when many calculators are open, navigating among them should not fail (all labels should be visible)", async () => {
// open 4 calculators
for (let i = 0; i < 4; i++) {
// open 8 calculators
for (let i = 0; i < 8; i++) {
await navbar.clickNewCalculatorButton();
await listPage.clickRandomCalculatorMenuEntry();
}
// navigate among them
for (let i = 0; i < 10; i++) {
for (let i = 0; i < 16; i++) {
await navbar.clickRandomCalculatorTab(i);
// test all form labels
const labels = calculatorPage.getInputLabels();
......
......@@ -12,7 +12,6 @@ export class NgBaseParam extends Observable {
constructor(symb: string, d: ParamDomain | ParamDomainValue, val: number) {
super();
console.log(">> new paramdef", symb);
this._param = new ParamDefinition(null, symb, d, val);
}
......
......@@ -91,7 +91,6 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
}
public set currentNub(n: Nub) {
console.log("set current nub", n);
const nubCalcType = (n.properties as Props).getPropValue("calcType");
if (this._props["calcType"] !== nubCalcType) {
throw new Error(
......@@ -102,23 +101,19 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
}
protected createNub(params: Props | {}): Nub {
console.log("create nub", params);
const props = params instanceof Props ? params : new Props(params);
return this._paramService.createNub(props);
}
protected replaceCurrentNub(params: Props) {
console.log("replace current nub", params);
this.currentNub = this._paramService.replaceNub(this._currentNub, params);
}
protected replaceNub(sn: Nub, params: Props): Nub {
console.log("replace nub", params);
return this._paramService.replaceNub(sn, params);
}
protected deleteNub(sn: Nub) {
console.log("delete nub", sn);
this._paramService.deleteNub(sn);
}
......
......@@ -162,6 +162,8 @@ export class FieldSet extends FormulaireElement implements Observer {
if (res) {
res.parseConfig(json, { "radioConfig": default_radio_config });
// set parent Nub on Parameter to ensure UID availability
res.paramDefinition.parent = this._nub;
}
return res;
......
......@@ -493,7 +493,6 @@ export class FormulaireService extends Observable {
// si oui, on demande à exclure des valeurs retournées le résultat du même nom que le paramètre
const exclude = np !== undefined ? p.paramDefinition.uid === np.uid : false;
console.log("ça passe 1");
// valeurs liables
const ps = sn.getLinkableValues(p.paramDefinition, undefined, exclude);
for (const npp of ps) {
......
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