diff --git a/front/assets/js/test_results/components/test_explorer.tsx b/front/assets/js/test_results/components/test_explorer.tsx index 79100b693..639ea4979 100644 --- a/front/assets/js/test_results/components/test_explorer.tsx +++ b/front/assets/js/test_results/components/test_explorer.tsx @@ -129,7 +129,8 @@ const FilterInfo = (state: { suites: types.Suite[], filteredSuites: types.Suite[ return sum.add(suite.summary); }, types.Summary.empty()); - const filteredSuiteSummary = filteredSuites.reduce((sum, suite) => { + // We need to use cloneDeep because syncSummary mutates the suite + const filteredSuiteSummary = _.cloneDeep(filteredSuites).reduce((sum, suite) => { suite.syncSummary(); return sum.add(suite.summary); }, types.Summary.empty()); diff --git a/front/assets/js/test_results/types/suite.ts b/front/assets/js/test_results/types/suite.ts index 20c6c53fd..c295bea48 100644 --- a/front/assets/js/test_results/types/suite.ts +++ b/front/assets/js/test_results/types/suite.ts @@ -55,7 +55,7 @@ export class Suite implements Stateful { syncSummary() { this.summary = new Summary({ - duration: this.tests.reduce((duration, test) => duration + test.duration, 0), + duration: this.summary.duration, total: this.tests.length, failed: this.tests.filter(test => test.state === State.FAILED).length, passed: this.tests.filter(test => test.state === State.PASSED).length,