Commit ea3d5157 authored by Dorchies David's avatar Dorchies David
Browse files

Merge branch '535-par-calage-et-simulation-repetition-des-parametres-dans-le-resultat' into 'devel'

Resolve "PAR Calage et Simulation: répétition des paramètres dans le résultat"

Closes #535

See merge request !134
parents 61c615a3 7f88752d
Pipeline #35825 failed with stages
in 11 minutes and 43 seconds
import { browser } from "protractor";
import { PreferencesPage } from "./preferences.po"
import { Navbar } from "./navbar.po";
import { ListPage } from "./list.po";
import { CalculatorPage } from "./calculator.po";
describe("ngHyd − check that results are not duplicated", () => {
let prefPage: PreferencesPage;
let navBar: Navbar;
let listPage: ListPage;
let calcPage: CalculatorPage;
beforeEach(async () => {
prefPage = new PreferencesPage();
listPage = new ListPage();
navBar = new Navbar();
calcPage = new CalculatorPage();
// disable evil option "empty fields on module creation"
await prefPage.navigateTo();
await browser.sleep(200);
await prefPage.disableEvilEmptyFields();
await browser.sleep(200);
});
it("in 'baffle fishway: setup' calculator", async () => {
// open baffle fishway setup calculator
await navBar.clickNewCalculatorButton();
await listPage.clickMenuEntryForCalcType(28);
await browser.sleep(200);
// run calculation
const calcButton = calcPage.getCalculateButton();
await calcButton.click();
// check result count
const fixRows = calcPage.getAllFixedResultsRows();
const nbRows = await fixRows.count();
console.log(nbRows);
expect(nbRows).toBe(24); // boundaries are included
});
});
......@@ -183,30 +183,6 @@ export class FixedResultsComponent extends ResultsComponentDirective {
}
}
}
// 2) else, is it a fixed parameter ?
if (! resultFound) {
for (const fp of this.fixedParams) {
if (fp.symbol === symbol) {
let label = this.formattedLabel(fp);
const nub = fp.paramDefinition.parentNub;
// add child type and position before label
if (nub && nub.parent && nub.parent.childrenType) {
const pos = nub.findPositionInParent();
// label = this.intlService.localizeText("INFO_OUVRAGE") + " n°" + (pos + 1) + ": " + label;
const cn = capitalize(this.intlService.childName(nub));
label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn)
+ (pos + 1) + ": " + label;
}
label += this._fixedResults.getHelpLink(symbol);
data.push({
label: label,
value: this.formattedValue(fp),
isCalcResult: false // for CSS
});
}
}
}
}
return data;
}
......
......@@ -108,7 +108,7 @@ export class FormulaireFixedVar extends FormulaireDefinition {
protected compute() {
this.runNubCalc(this.currentNub);
this.refreshFieldsets(); // important: before reaffectResultComponents() or it will break results components localization
this.reaffectResultComponents();
// this.reaffectResultComponents(); // seems useless since called from runNubCalc()
}
protected reaffectResultComponents() {
......
......@@ -355,6 +355,7 @@ export class VarResults extends CalculatedParamResults implements PlottableData
// result keys (extra or not) - some lines might miss some results, in case of an error;
// use those keys to ensure all columns are filled
if (this.resultKeys.length === 0) {
this.resultKeys.push(this.result.symbol);
for (const re of this.result.resultElements) { // re:ResultElement
for (const erk in re.values) {
if (!this.resultKeys.includes(erk)) {
......
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