Skip to content

Commit

Permalink
Merge pull request #258 from kubeshop/mm.fix/testdetailstable
Browse files Browse the repository at this point in the history
fix: remove undefined element from spanAssertionList
  • Loading branch information
mortada-codes committed Apr 20, 2022
2 parents ce97932 + 2856b2f commit 77ab898
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions web/src/pages/Test/TestDetailsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,20 @@ const getTestResultCount = (assertionResultList: AssertionResultList, type: 'all

if (type === 'all') return spanAssertionList.length;

return spanAssertionList.filter(({passed}) => {
switch (type) {
case 'failed': {
return !passed;
}
return spanAssertionList
.filter(el => el)
.filter(({passed}) => {
switch (type) {
case 'failed': {
return !passed;
}

case 'passed':
default: {
return passed;
case 'passed':
default: {
return passed;
}
}
}
}).length;
}).length;
};

const TextDetailsTable: FC<TextRowProps> = ({isLoading, onSelectResult, testResultList}) => {
Expand Down

0 comments on commit 77ab898

Please sign in to comment.