From 4e230378beef3c5841bf01c42b8a6140abcde252 Mon Sep 17 00:00:00 2001 From: Alison Joseph Date: Wed, 3 Jan 2024 11:08:58 -0600 Subject: [PATCH] chore: wip --- src/components/A11yStatus/A11yStatus.js | 38 ++++++++++++++----------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/components/A11yStatus/A11yStatus.js b/src/components/A11yStatus/A11yStatus.js index 912938faa43..cf45084095b 100644 --- a/src/components/A11yStatus/A11yStatus.js +++ b/src/components/A11yStatus/A11yStatus.js @@ -50,34 +50,38 @@ class A11yStatus extends React.Component { .replace(' ', '-')}/usage`; } - // Iterate through all specs in the suite, and all tags in - // each spec, to determine if there is _any_ spec that includes - // a tag we're looking for. - const hasDefaultAVT = componentTestData.suites.some((suite) => { - return suite.specs.some((spec) => { - return spec.tags.some((tag) => { - return tag.includes('avt-default-state'); + let hasDefaultAVT = false; + let hasComplexAVT = false; + let hasKeyboardNavAVT = false; + if (componentTestData) { + // Iterate through all specs in the suite, and all tags in + // each spec, to determine if there is _any_ spec that includes + // a tag we're looking for. + + hasDefaultAVT = componentTestData.suites.some((suite) => { + return suite.specs.some((spec) => { + return spec.tags.some((tag) => { + return tag.includes('avt-default-state'); + }); }); }); - }); - const hasComplexAVT = componentTestData.suites.some((suite) => { - return suite.specs.some((spec) => { - return spec.tags.some((tag) => { - return tag.includes('avt-advanced-states'); + hasComplexAVT = componentTestData.suites.some((suite) => { + return suite.specs.some((spec) => { + return spec.tags.some((tag) => { + return tag.includes('avt-advanced-states'); + }); }); }); - }); - const hasKeyboardNavAVT = componentTestData.suites.some( - (suite) => { + hasKeyboardNavAVT = componentTestData.suites.some((suite) => { return suite.specs.some((spec) => { return spec.tags.some((tag) => { return tag.includes('avt-keyboard-nav'); }); }); - } - ); + }); + } return ( <>