-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): scenario execution report - Flatten one iteration for strat…
…egy steps (#42)
- Loading branch information
1 parent
89d6bf2
commit 40e2f72
Showing
4 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
chutney/ui/src/app/core/model/scenario/step-execution-report.model.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2017-2024 Enedis | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
import { StepExecutionReport } from "./step-execution-report.model"; | ||
|
||
describe('StepExecutionReportTest', () => { | ||
it('should flatten one iteration for strategy', () => { | ||
var report = { | ||
name: 'root step to be flatten', | ||
steps: [ | ||
{ | ||
name: 'Step with one iteration - <i> - ${#dk}', | ||
steps: [ | ||
{ | ||
name: 'Step with one iteration - 0 - one' | ||
} | ||
], | ||
strategy: 'for' | ||
}, | ||
{ | ||
name: 'Step with one iteration - <i> - ${#dk}', | ||
steps: [ | ||
{ | ||
name: 'Step with one iteration - 0 - one', | ||
steps: [ | ||
{ | ||
name: 'Child with one iteration - 0 - <j> - ${#dkk}', | ||
steps: [ | ||
{ | ||
name: 'Child with one iteration - 0 - 0 - one' | ||
} | ||
], | ||
strategy: 'for' | ||
} | ||
] | ||
} | ||
], | ||
strategy: 'for' | ||
} | ||
] | ||
} as StepExecutionReport; | ||
let initialReport = Object.assign({}, report) | ||
let cleanedReport = StepExecutionReport.cleanReport(report); | ||
expect(cleanedReport).toBe(report); | ||
expect(cleanedReport.name).toBe(initialReport.name); | ||
expect(cleanedReport.steps).toHaveSize(2); | ||
expect(cleanedReport.steps[0]).toBe(initialReport.steps[0].steps[0]); | ||
expect(cleanedReport.steps[1].name).toBe(initialReport.steps[1].steps[0].name); | ||
expect(cleanedReport.steps[1].steps[0]).toBe(initialReport.steps[1].steps[0].steps[0]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters