-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Support disabling rules for particular tests #107
Labels
Comments
Storybook already allows for this, assuming you're using their addon: https://github.com/storybookjs/storybook/tree/next/addons/a11y#story-level-overrides If you're utilizing the test-runner they wrote a blog post about recently, then I haven't yet found a "clean" solution but it is doable albeit there's some manual work involved: async postRender(page, context) {
const disabledRulesForStory = () => {
switch (context.id) {
case "fields-input--basic-usage": // <-- You have to manually keep track of the stories and which rules to ignore for each
return {
"label": {
enabled: false
}
}
default:
return {}
}
}
const violations = await getViolations(page, "#root", {
detailedReport: true,
rules: {
...disabledRulesForStory()
},
});
// ...Rest of your code
} |
Thanks, I am indeed using the test-runner. @yannbf you might be interested in this ^. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using this tool along with storybook, but there are some times when I'd like to disable failures for certain stories. For instance, I have a story of an
input
element, which is intended to be used together with a label, but my stories show the input by itself. I'd like to silence the errorEnsures every form element has a label
for these stories. Is there a way I can do this currently, and if not, is it a feature you might consider adding?The text was updated successfully, but these errors were encountered: