From 7141d6d5b46398a0c1dc009c0693c7709245fb33 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Tue, 10 Dec 2024 13:40:45 +0100 Subject: [PATCH] Filter out falsy test results in TestProviderRender for improved data handling and to avoid accessing undefined --- code/addons/test/src/components/TestProviderRender.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/code/addons/test/src/components/TestProviderRender.tsx b/code/addons/test/src/components/TestProviderRender.tsx index d9d68aef04d1..017ecc2cf27f 100644 --- a/code/addons/test/src/components/TestProviderRender.tsx +++ b/code/addons/test/src/components/TestProviderRender.tsx @@ -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')) );