Skip to content

Commit

Permalink
[docs-infra] Skip non React components in visual regressions (#41708)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharatkashyap authored Apr 3, 2024
1 parent c3c72ad commit 81ad214
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/regressions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const blacklist = [
'docs-getting-started-templates-sign-in/CustomIcons.png', // Theme file
'docs-getting-started-templates-sign-up/CustomIcons.png', // Theme file
'docs-getting-started-templates-sign-in-side/getSignInSideTheme.png', // Theme file
'docs-getting-started-templates-sign-in/getSignInTheme.png', // Theme file
'docs-getting-started-templates-sign-up/getSignUpTheme.png', // Theme file
'docs-getting-started-templates-checkout/getCheckoutTheme.png', // Theme file
'docs-getting-started-templates-landing-page/getLPTheme.png', // Theme file
Expand Down Expand Up @@ -173,6 +172,13 @@ function excludeDemoFixture(suite, name) {
return true;
}

// Exclude files that are not images and are not PascalCase
// Tantamount to skipping JS/TS files that are not React components or "index.js" files
// PascalCase starts with a capital letter and has zero or more capital letters in the middle
if (!suite.endsWith('.png') && name !== 'index' && !/^[A-Z][A-Za-z0-9]*$/.test(name)) {
return true;
}

if (suite.includes('docs-joy') && name.match(/(Variables|Usage)$/)) {
return true;
}
Expand Down

0 comments on commit 81ad214

Please sign in to comment.