Проверка доступности через axe в test-runner - #130
Merged
Conversation
khaliulin
force-pushed
the
storybook-style-snapshots
branch
from
August 26, 2026 12:41
269a68e to
d27a905
Compare
khaliulin
force-pushed
the
storybook-a11y-checks
branch
from
August 26, 2026 12:41
fb4c9c2 to
d16f281
Compare
Contributor
Author
|
Переписал коммит: конфиг тест-раннера больше не протекает в stories. Опт-ины переехали в Во всём стеке теперь ноль изменённых stories — только Проверка после переписывания: полный прогон |
Пиксельные снимки для теней, пунктира и форм
ichiesov
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что
preVisitинжектит axe,postVisitпрогоняет его по#storybook-root. Гейтятся только нарушения уровняcriticalиserious—moderate/minoraxe тоже находит, но там много спорного.Добавлен
axe-playwright@2.2.2в devDependencies.Почему с baseline, а не «в лоб»
Первый прогон без baseline: 129 из 264 stories падают. Это накопленный долг PrimeNG и обёрток, его не закрыть одним PR, а красный на старте гейт никто чинить не будет — его просто отключат.
Поэтому известные нарушения ложатся в
.storybook/a11y-baseline/<storyId>.json(список id правил), и прогон падает только на новом. Регрессии ловятся с первого дня.Baseline ведётся по id правила, без числа затронутых элементов — иначе он дёргался бы от каждой правки разметки.
В репозиторий baseline не кладётся — как и пиксельные снимки из #131: каталог под игнором, первый прогон на чистой копии снимает его сам, дальше сверяется с ним. В
Files changedчетыре файла:.gitignore,.storybook/test-runner.ts,package.json,package-lock.json.Что накопилось
color-contrastlabelbutton-namearia-input-field-namearia-valid-attr-valuearia-allowed-attrscrollable-region-focusablearia-required-parentaria-meter-namearia-required-childrenaria-dialog-namelink-name,image-alt,aria-progressbar-namearia-required-attr,nested-interactive,aria-command-namecolor-contrastв половине списка — это, скорее всего, один системный промах в токенах, а не 51 отдельная проблема. Отдельная тема, сюда не тащу.Как чинить долг
Из диффа baseline видно ровно то, что закрыто: файл ужался или исчез. Правило, пропавшее из нарушений, само из baseline не уходит — нужен явный пересбор.
Точечное отключение работает через штатный параметр аддона a11y:
Проверка
1 failed, 51 passed, 38–49 с;.storybook/a11y-baseline/components-button--icons.json— story честно упала с[a11y/critical] button-name: Buttons must have discernible text (18 элем.), после возврата снова зелено;21 passed, снимок создан сам и совпал с прежним содержимым файлов.