Skip to content

Commit

Permalink
chore(a11y): clean up a11y config so we test valid URLs and limit tim…
Browse files Browse the repository at this point in the history
…eouts (#9328)

* chore(a11y): clean up a11y config so we test valid URLs and limit timeouts

* tighten logic a little more

* remove console statement

* use logical OR rather than bitwise
  • Loading branch information
nicolethoen authored Aug 14, 2023
1 parent 388cfeb commit ebfafc4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/react-docs/patternfly-a11y.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,25 @@ const urls = Object.keys(fullscreenRoutes)
if (fullscreenRoutes[key].isFullscreenOnly) {
return key;
} else {
// the default tab for each component/pattern does not have a trailing 'react-demo' or 'react' string in the url
// so we strip the trailing string from those paths.
const path = fullscreenRoutes[key].path;
if (path.match(/\/demos\/.*\/react-demos$/g)) {
if (path.match(/\/patterns\/.*\/react-demos$/g)) {
return path.replace(/\/react-demos$/, '');
} else {
// some demos have been moved to the component section, so their default tab has a trailing 'react-demos'
if (path.match(/\/components\/.*\/react-demos$/g)){
if (path.includes('/application-launcher/') ||
path.includes('/context-selector/') ||
path.includes('/date-and-time-picker/') ||
path.includes('/password-generator/') ||
path.includes('/password-strength/') ||
path.includes('/custom-menus/') ||
path.includes('/options-menu/')) {
return path.replace(/\/react-demos$/, '');
}
}
// all other pages in the components section have a trailing 'react' string in their default tab
return path.replace(/\/react$/, '');
}
}
Expand Down

0 comments on commit ebfafc4

Please sign in to comment.