Skip to content

Commit

Permalink
Filter out falsy test results in TestProviderRender for improved data…
Browse files Browse the repository at this point in the history
… handling and to avoid accessing undefined
  • Loading branch information
valentinpalkovic committed Dec 10, 2024
1 parent 7389774 commit 7141d6d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions code/addons/test/src/components/TestProviderRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const TestProviderRender: FC<

return state.details?.testResults?.flatMap((result) =>
result.results
.filter(Boolean)
.filter((r) => !entryId || r.storyId === entryId || r.storyId?.startsWith(`${entryId}-`))
.map((r) => r.reports.find((report) => report.type === 'a11y'))
);
Expand Down

0 comments on commit 7141d6d

Please sign in to comment.