diff --git a/frontend/cypress/support/helper/scoringSupport.ts b/frontend/cypress/support/helper/scoringSupport.ts index 93992f39b2..f78942b5d9 100644 --- a/frontend/cypress/support/helper/scoringSupport.ts +++ b/frontend/cypress/support/helper/scoringSupport.ts @@ -36,19 +36,18 @@ export function getPercentageMetric(baseline: number, stretchGoal: number, value } export function getPercentageOrdinal(zone: string) { - if (zone == 'stretch') { - return 101; + switch (zone) { + case 'fail': + return 30; + case 'commit': + return 70; + case 'target': + return 99.99; + case 'stretch': + return 101; + default: + return 0; } - if (zone == 'target') { - return 99.99; - } - if (zone == 'commit') { - return 70; - } - if (zone == 'fail') { - return 30; - } - return 0; } function validateScoringWidth(zone: string, percent: number, isOverview: boolean) {