From 65a99976b9077fbbe1ae0c5398959789d57ae572 Mon Sep 17 00:00:00 2001 From: Iveta Date: Tue, 6 Jun 2023 17:53:14 -0400 Subject: [PATCH] Check to make sure testRun exists (#112) --- ui/src/views/TestRunner.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/src/views/TestRunner.tsx b/ui/src/views/TestRunner.tsx index 7348db1..4610499 100644 --- a/ui/src/views/TestRunner.tsx +++ b/ui/src/views/TestRunner.tsx @@ -156,15 +156,17 @@ export const TestRunner = () => { const sepArray = testRunArrayCopy.find(({ sep }) => sep === test.sep); if (sepArray) { const testRun = sepArray.tests[testRunOrderMap[getTestRunId(test)]]; - if (result) { - if (result.failureMode) { - sepArray.progress.failed++; - } else { - sepArray.progress.passed++; + if (testRun) { + if (result) { + if (result.failureMode) { + sepArray.progress.failed++; + } else { + sepArray.progress.passed++; + } + numberOfTestsRun.current++; } - numberOfTestsRun.current++; + testRun.result = result; } - testRun.result = result; } setTestRunArray(testRunArrayCopy);