An open source design system that's fully customizable and agent ready
TypeScript
fix(a11y): map ChatAdditions stories to Lab Chat scope (#6649)
RKS35a722f0b564
diff --git a/.github/scripts/a11y-pr-scope.test.mjs b/.github/scripts/a11y-pr-scope.test.mjsindex a7eaaefe4e..8ad02f1116 100644--- a/.github/scripts/a11y-pr-scope.test.mjs+++ b/.github/scripts/a11y-pr-scope.test.mjs@@ -112,6 +112,54 @@ describe('fast PR accessibility scope', () => {).toThrow('No scoped Storybook route');});+ it('audits Lab Chat additions through the Chat umbrella without selecting other Lab stories', () => {+ const routes = buildStoryComponentRoutes({+ stories: [+ {id: 'lab-chatadditions--reactions', title: 'Lab/ChatAdditions'},+ {+ id: 'lab-chatadditions--typing-and-unread',+ title: 'Lab/ChatAdditions',+ },+ {id: 'lab-chatadditions--emoji-picker', title: 'Lab/ChatAdditions'},+ {id: 'lab-drawer--showcase', title: 'Lab/Drawer'},+ ],+ publicComponentsByPackage: {+ lab: [+ 'ChatEmojiPicker',+ 'ChatReactionBar',+ 'ChatTypingIndicator',+ 'ChatUnreadDivider',+ 'Drawer',+ ],+ },+ }).map(route => ({+ ...route,+ component: storyIdentity.ownerForA11yStory(route.id) ?? route.component,+ }));+ const chatScope = resolvePrA11yComponents(+ analysis({unresolvedComponentSources: ['lab/Chat']}),+ process.cwd(),+ routes,+ );+ expect(chatScope).toEqual(['lab/Chat']);+ expect(unresolvedComponentFilters(routes, chatScope)).toEqual([]);+ expect(storyIdsForComponentFilters(routes, chatScope)).toEqual([+ 'lab-chatadditions--reactions',+ 'lab-chatadditions--typing-and-unread',+ 'lab-chatadditions--emoji-picker',+ ]);++ const drawerScope = resolvePrA11yComponents(+ analysis({modifiedComponentOwners: ['lab/Drawer']}),+ process.cwd(),+ routes,+ );+ expect(drawerScope).toEqual(['lab/Drawer']);+ expect(storyIdsForComponentFilters(routes, drawerScope)).toEqual([+ 'lab-drawer--showcase',+ ]);+ });+it('routes NavHeadingMenu through its normalized NavMenu umbrella', () => {const routes = buildStoryComponentRoutes({stories: [diff --git a/.github/scripts/lib/a11y-story-identity.js b/.github/scripts/lib/a11y-story-identity.jsindex b19434aaa6..1420b30122 100644--- a/.github/scripts/lib/a11y-story-identity.js+++ b/.github/scripts/lib/a11y-story-identity.js@@ -5,12 +5,13 @@/*** @file Canonical owners and audited legacy-baseline aliases for a11y contract stories.- * @input Stable Storybook IDs from checked-in a11y inventories and audit fixtures.+ * @input Stable Storybook IDs from checked-in a11y inventories, audit fixtures, and Lab Chat additions.* @output Canonical package owners plus exact prior baseline story identities.* @position Migration boundary between reusable contract fixtures and the a11y baseline.*/const A11Y_STORY_OWNER_PREFIXES = Object.freeze([+ ['lab-chatadditions--', 'lab/Chat'],['a11y-button-pattern--icon-button-', 'core/IconButton'],['a11y-button-pattern--clickable-card-', 'core/ClickableCard'],['a11y-button-pattern--sidenav-collapse-', 'core/SideNavCollapseButton'],