An open source design system that's fully customizable and agent ready
TypeScript
ci(a11y): remove the 74 baseline entries that no longer occur, and warn when one stops occurring (#10004)
Cindy Zhang7cda408b49d5
diff --git a/.github/a11y-baseline.json b/.github/a11y-baseline.jsonindex 4313c838d1..d2295bf73d 100644--- a/.github/a11y-baseline.json+++ b/.github/a11y-baseline.json@@ -3,51 +3,16 @@"version": 1,"generatedAt": "2026-10-24T15:57:55.439Z","entries": [- {- "key": "Badge::Status Labels::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Badge::Variants::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Chat::Message Status::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Chat::Multi-Bubble Grouping::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "ChatComposer::Disabled::color-contrast","impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "ChatComposerInput::Controlled::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "ChatComposerInput::Disabled::color-contrast","impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "ChatComposerInput::Mention Trigger::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "ChatComposerInput::Multiple Triggers::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "ChatReasoning::Collapsed::color-contrast","impact": "serious",@@ -68,46 +33,6 @@"impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "ChatToolCalls::All Statuses::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "ChatToolCalls::Interactive::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "ChatToolCalls::Many Calls::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "ChatToolCalls::Multiple Calls::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "ChatToolCalls::With Stats::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "CheckboxList::All Variations::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "CheckboxList::Disabled With Message::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "CheckboxList::Disabled::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "ClickableCard::Disabled::color-contrast","impact": "serious",@@ -138,11 +63,6 @@"impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "CodeEditorTheme::All Themes Gallery::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "CodeEditorTheme::Catppuccin Latte::color-contrast","impact": "serious",@@ -278,11 +198,6 @@"impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "Collapsible::Controlled::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "FileInput::All Variations::color-contrast","impact": "serious",@@ -298,16 +213,6 @@"impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "Grid::Dashboard Layout::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Grid::Gallery Example::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "GridMasonry::Masonry Gallery::color-contrast","impact": "serious",@@ -318,151 +223,11 @@"impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "InputGroup::All Variations::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "InputGroup::Full Width::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "InputGroup::With Date Input::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "InputGroup::With Multi Selector::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "InputGroup::With Prefix And Suffix::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "InputGroup::With Selector::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "InputGroup::With Suffix::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "InputGroup::With Time Input::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "InputGroup::With Typeahead::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Item::Contact List::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Item::File Browser::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Kbd::Inline With Text::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Kbd::Multiple Modifiers::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Kbd::Special Keys::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Content Width — Both Panels::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Content Width — Dividers, No Panels::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Content Width — Narrower Than Container::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Content Width — Nested in AppShell::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Content Width — No Dividers::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Content Width — Responsive Panels::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "Layout::Content Width — Start Panel::color-contrast","impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "Layout::Content Width — Wider Than Container::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Dual Panel Layout::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Full Bleed Content::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Outer Padding Demonstration::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Playground::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Section Variants::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Layout::Themed Layout (Neutral vs Stone)::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "List::With Media::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "LogStream::Controlled Follow::color-contrast","impact": "serious",@@ -478,16 +243,6 @@"impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "OverflowList::With Badges::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Overlay::Drag And Drop::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "PopArt::Debug Projection::color-contrast","impact": "serious",@@ -523,71 +278,6 @@"impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "RadioList::All Variations::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "RadioList::Disabled With Message::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "RadioList::Disabled::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Schedule::Async Loader::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Schedule::Monthly::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Schedule::View Selector Plugin::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Schedule::Weekly Fixed Height::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Schedule::Weekly::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Section::With Inner Layout::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Section::With Simple Content::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "SegmentedControl::Default::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "SegmentedControl::Disabled Item::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "SegmentedControl::Size Variants::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "SegmentedControl::With Icons::color-contrast","impact": "serious",@@ -598,61 +288,11 @@"impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "Stepper::Edge — Disabled Steps::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Stepper::Slots — endContent (trailing badges)::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Table::In Card Densities::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "Table::In Card With Section::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "Table::In Card::color-contrast","impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "Table::Standalone Vs Container::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "TableGroupedRows::Custom Order And Header::aria-conditional-attr",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/aria-conditional-attr?application=playwright"- },- {- "key": "TableGroupedRows::Default::aria-conditional-attr",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/aria-conditional-attr?application=playwright"- },- {- "key": "TableGroupedRows::Default::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },- {- "key": "TableGroupedRows::Initially Collapsed::aria-conditional-attr",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/aria-conditional-attr?application=playwright"- },- {- "key": "TableGroupedRows::Initially Collapsed::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "TableTree::Default::aria-conditional-attr","impact": "serious",@@ -698,21 +338,11 @@"impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "Theme::Bar Chart Dark::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "Theme::Theme Comparison::color-contrast","impact": "serious","helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"},- {- "key": "Thumbnail::Media Mode (dark vs light images)::color-contrast",- "impact": "serious",- "helpUrl": "https://dequeuniversity.com/rules/axe/4.12/color-contrast?application=playwright"- },{"key": "Thumbnail::Remove on hover::color-contrast","impact": "serious",diff --git a/.github/scripts/accessibility-audit.js b/.github/scripts/accessibility-audit.jsindex 92607665ea..a365dc4b90 100644--- a/.github/scripts/accessibility-audit.js+++ b/.github/scripts/accessibility-audit.js@@ -13,8 +13,9 @@* --fail-on-new (exit 1 when violations not present in the baseline exist)* --update-baseline (rewrite the baseline file from this run's report)* @output JSON report with accessibility violations; with --baseline, a gate- * summary (new / baselined / resolved) on stdout and a non-zero exit code- * when --fail-on-new finds regressions. Diff logic lives in+ * summary (new / baselined / resolved) on stdout, a warning annotation on+ * GitHub Actions when baseline entries no longer occur, and a non-zero exit+ * code when --fail-on-new finds regressions. Diff logic lives in* lib/a11y-baseline.js. Pages are scanned with animations held at their end* state.* @position Blocking PR accessibility audit; scoped stories share canonical@@ -35,6 +36,7 @@ const {buildBaseline,diffAgainstBaseline,formatDiffSummary,+ formatResolvedWarning,storyKey,} = require('./lib/a11y-baseline');const {waitForStoryReadiness} = require('./lib/a11y-story-readiness');@@ -689,6 +691,10 @@ function applyBaselineGate(report) {const baseline = loadBaselineFile(baselineFile);const diff = diffAgainstBaseline(report, baseline);console.log(formatDiffSummary(diff, { baselinePath: baselineFile }));+ const resolvedWarning = formatResolvedWarning(diff, { baselinePath: baselineFile });+ if (resolvedWarning && process.env.GITHUB_ACTIONS === 'true') {+ console.log(resolvedWarning);+ }if (diff.newViolations.length > 0 && failOnNew) {console.error(diff --git a/.github/scripts/lib/a11y-baseline.js b/.github/scripts/lib/a11y-baseline.jsindex fdccdab72d..0b1a275bdd 100644--- a/.github/scripts/lib/a11y-baseline.js+++ b/.github/scripts/lib/a11y-baseline.js@@ -419,6 +419,32 @@ function formatDiffSummary(return lines.join('\n');}+/**+ * Render a GitHub Actions warning when baseline entries no longer occur, so a+ * stale entry shows on the run's summary page and is not only in the log. A+ * stale entry can mask a returning violation of the same kind. It never fails+ * the gate.+ *+ * @param {{resolved: string[]}} diff+ * @param {{baselinePath?: string}} [options]+ * @returns {string} The workflow command, or '' when nothing resolved.+ */+function formatResolvedWarning(+ diff,+ {baselinePath = '.github/a11y-baseline.json'} = {},+) {+ const count = diff.resolved.length;+ if (count === 0) return '';+ const what =+ count === 1+ ? '1 baseline entry no longer occurs; remove it'+ : `${count} baseline entries no longer occur; remove them`;+ return (+ `::warning title=Resolved accessibility baseline entries::${what} ` ++ `from ${baselinePath}. The keys are in this step's log.`+ );+}+module.exports = {BASELINE_VERSION,storyKey,@@ -428,4 +454,5 @@ module.exports = {buildBaseline,diffAgainstBaseline,formatDiffSummary,+ formatResolvedWarning,};diff --git a/.github/scripts/lib/a11y-baseline.test.mjs b/.github/scripts/lib/a11y-baseline.test.mjsindex 96f2890962..d9a7211952 100644--- a/.github/scripts/lib/a11y-baseline.test.mjs+++ b/.github/scripts/lib/a11y-baseline.test.mjs@@ -13,6 +13,7 @@ import {collectViolations,diffAgainstBaseline,formatDiffSummary,+ formatResolvedWarning,violationKey,} from './a11y-baseline.js';@@ -117,7 +118,11 @@ function makeMultiRoutedReport(rows, {legacyBaselineAliases = {}} = {}) {});legacyStoryOwners[legacyStoryKey] ??= [];legacyStoryOwners[legacyStoryKey].push(canonicalStoryKey);- components[row.component] ??= {storiesAudited: 0, violations: [], storyDetails: []};+ components[row.component] ??= {+ storiesAudited: 0,+ violations: [],+ storyDetails: [],+ };components[row.component].storiesAudited += 1;if (row.ruleId) {components[row.component].storyDetails.push({@@ -129,8 +134,8 @@ function makeMultiRoutedReport(rows, {legacyBaselineAliases = {}} = {}) {}return {auditedStories,- auditedStoryKeys: auditedStories.map(({owner, storyId}) =>- `${owner}::${storyId}`,+ auditedStoryKeys: auditedStories.map(+ ({owner, storyId}) => `${owner}::${storyId}`,),legacyStoryOwners,legacyBaselineAliases,@@ -304,8 +309,7 @@ describe('diffAgainstBaseline', () => {legacyStoryOwners,});const legacyKey = 'Tooltip::Default::color-contrast';- const coreKey =- 'core/Tooltip::core-tooltip--default::color-contrast';+ const coreKey = 'core/Tooltip::core-tooltip--default::color-contrast';const chartsKey ='charts/ChartTooltip::charts-chrome-tooltip--default::color-contrast';const diff = diffAgainstBaseline(scopedReport, {@@ -328,9 +332,9 @@ describe('diffAgainstBaseline', () => {version: 1,entries: [{key: legacyKey}],});- expect(collisionDiff.newViolations.map(violation => violation.key)).toEqual([- chartsKey,- ]);+ expect(collisionDiff.newViolations.map(violation => violation.key)).toEqual(+ [chartsKey],+ );expect(collisionDiff.unchecked).toEqual([legacyKey]);});@@ -359,9 +363,7 @@ describe('diffAgainstBaseline', () => {});expect(diff.newViolations.map(violation => violation.key).sort()).toEqual(- rows- .map(row => `${row.owner}::${row.storyId}::${row.ruleId}`)- .sort(),+ rows.map(row => `${row.owner}::${row.storyId}::${row.ruleId}`).sort(),);expect(diff.resolved).toEqual([]);expect(diff.unchecked).toEqual([legacyKey]);@@ -378,8 +380,7 @@ describe('diffAgainstBaseline', () => {},{owner: 'core/CheckboxListItem',- storyId:- 'a11y-checkbox-pattern--list-item-group-disabled-with-message',+ storyId: 'a11y-checkbox-pattern--list-item-group-disabled-with-message',component: 'Checkbox pattern',story: 'List Item Group Disabled With Message',ruleId: 'color-contrast',@@ -401,8 +402,7 @@ describe('diffAgainstBaseline', () => {},{owner: 'core/RadioListItem',- storyId:- 'a11y-radio-group-pattern--radio-list-option-group-disabled',+ storyId: 'a11y-radio-group-pattern--radio-list-option-group-disabled',component: 'Radio group pattern',story: 'Radio List Option Group Disabled',ruleId: 'color-contrast',@@ -447,9 +447,7 @@ describe('diffAgainstBaseline', () => {existing: {version: 1, entries: legacyKeys},}).entries.map(entry => entry.key);expect(migrated).toEqual(- rows- .map(row => `${row.owner}::${row.storyId}::${row.ruleId}`)- .sort(),+ rows.map(row => `${row.owner}::${row.storyId}::${row.ruleId}`).sort(),);});});@@ -598,8 +596,7 @@ describe('buildBaseline', () => {});it('migrates a unique audited legacy key to package and story identity', () => {- const legacyKey =- 'RichTextEditor::With Toolbar::aria-input-field-name';+ const legacyKey = 'RichTextEditor::With Toolbar::aria-input-field-name';const scopedReport = makeRoutedReport({owner: 'richtext/RichTextEditorToolbar',storyId: 'lab-richtexteditor--with-toolbar',@@ -653,3 +650,57 @@ describe('formatDiffSummary', () => {expect(summary).toContain('Gate passed');});});++describe('formatResolvedWarning', () => {+ it('is empty when every baseline entry still occurs', () => {+ const report = makeReport({+ Button: {Primary: [axeViolation('button-name')]},+ });+ const diff = diffAgainstBaseline(report, {+ version: 1,+ entries: ['Button::Primary::button-name'],+ });+ expect(diff.resolved).toEqual([]);+ expect(formatResolvedWarning(diff)).toBe('');+ });++ it('warns, without failing, when one baseline entry no longer occurs', () => {+ const report = makeReport({Button: {Primary: []}});+ const diff = diffAgainstBaseline(report, {+ version: 1,+ entries: ['Button::Primary::button-name'],+ });+ expect(diff.newViolations).toEqual([]);+ expect(formatResolvedWarning(diff)).toBe(+ '::warning title=Resolved accessibility baseline entries::1 baseline entry no longer occurs; ' ++ "remove it from .github/a11y-baseline.json. The keys are in this step's log.",+ );+ });++ it('counts every resolved entry and names the baseline path it was given', () => {+ const warning = formatResolvedWarning(+ {resolved: ['A::One::color-contrast', 'B::Two::color-contrast']},+ {baselinePath: 'custom/baseline.json'},+ );+ expect(warning).toMatch(/^::warning /);+ expect(warning).toContain(+ '2 baseline entries no longer occur; remove them',+ );+ expect(warning).toContain('custom/baseline.json');+ });++ it('leaves an entry outside the audited stories out of the count', () => {+ const report = makeReport({Button: {Primary: []}});+ const diff = diffAgainstBaseline(report, {+ version: 1,+ entries: [+ 'Button::Primary::button-name',+ 'Dialog::Default::aria-dialog-name',+ ],+ });+ expect(diff.unchecked).toEqual(['Dialog::Default::aria-dialog-name']);+ expect(formatResolvedWarning(diff)).toContain(+ '1 baseline entry no longer occurs',+ );+ });+});diff --git a/.github/scripts/lib/a11y-story-identity.js b/.github/scripts/lib/a11y-story-identity.jsindex 1b40c06abe..6124432c62 100644--- a/.github/scripts/lib/a11y-story-identity.js+++ b/.github/scripts/lib/a11y-story-identity.js@@ -39,26 +39,10 @@ const LEGACY_BASELINE_STORY_MIGRATIONS = Object.freeze({owner: 'core/ClickableCard',legacyStoryKeys: Object.freeze(['ClickableCard::Disabled']),}),- 'a11y-checkbox-pattern--list-item-group-disabled-with-message': Object.freeze({- owner: 'core/CheckboxListItem',- legacyStoryKeys: Object.freeze(['CheckboxList::Disabled With Message']),- }),'a11y-checkbox-pattern--card-disabled': Object.freeze({owner: 'core/SelectableCard',legacyStoryKeys: Object.freeze(['SelectableCard::Disabled']),}),- 'a11y-radio-group-pattern--radio-list-group-disabled-with-message': Object.freeze({- owner: 'core/RadioList',- legacyStoryKeys: Object.freeze(['RadioList::Disabled With Message']),- }),- 'a11y-radio-group-pattern--radio-list-option-group-disabled': Object.freeze({- owner: 'core/RadioListItem',- legacyStoryKeys: Object.freeze(['RadioList::Disabled']),- }),- 'a11y-radio-group-pattern--radio-list-option-disabled-with-message': Object.freeze({- owner: 'core/RadioListItem',- legacyStoryKeys: Object.freeze(['RadioList::Disabled With Message']),- }),'a11y-progressbar--progress-bar-disabled': Object.freeze({owner: 'core/ProgressBar',legacyStoryKeys: Object.freeze(['ProgressBar::Disabled']),diff --git a/.github/scripts/lib/a11y-story-identity.test.mjs b/.github/scripts/lib/a11y-story-identity.test.mjsindex 7d0725959b..40da398b95 100644--- a/.github/scripts/lib/a11y-story-identity.test.mjs+++ b/.github/scripts/lib/a11y-story-identity.test.mjs@@ -11,7 +11,10 @@ import {ownerForA11yStory,} from './a11y-story-identity.js';-const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../..');+const ROOT = path.resolve(+ path.dirname(fileURLToPath(import.meta.url)),+ '../../..',+);const baseline = JSON.parse(fs.readFileSync(path.join(ROOT, '.github/a11y-baseline.json'), 'utf8'),);@@ -23,36 +26,16 @@ const EXPECTED_MIGRATIONS = ['core/ClickableCard','a11y-button-pattern--clickable-card-disabled',],- [- 'CheckboxList::Disabled With Message',- 'core/CheckboxListItem',- 'a11y-checkbox-pattern--list-item-group-disabled-with-message',- ],['SelectableCard::Disabled','core/SelectableCard','a11y-checkbox-pattern--card-disabled',],- [- 'RadioList::Disabled With Message',- 'core/RadioList',- 'a11y-radio-group-pattern--radio-list-group-disabled-with-message',- ],['ProgressBar::Disabled','core/ProgressBar','a11y-progressbar--progress-bar-disabled',],- [- 'RadioList::Disabled',- 'core/RadioListItem',- 'a11y-radio-group-pattern--radio-list-option-group-disabled',- ],- [- 'RadioList::Disabled With Message',- 'core/RadioListItem',- 'a11y-radio-group-pattern--radio-list-option-disabled-with-message',- ],];describe('a11y story identity migration', () => {@@ -115,7 +98,7 @@ describe('a11y story identity migration', () => {}});- it('contains only the seven proven legacy migrations', () => {+ it('contains only the three proven legacy migrations', () => {expect(Object.keys(LEGACY_BASELINE_STORY_MIGRATIONS).sort()).toEqual(EXPECTED_MIGRATIONS.map(([, , storyId]) => storyId).sort(),);