storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.21k stars 9.26k forks source link

Addon-a11y - Disable accessibility tab in a single story #6849

Closed Aekal closed 5 years ago

Aekal commented 5 years ago

Describe the bug I can't find a way to disable accessibility tab in a single story. In config.js I have defined decorator addDecorator(withA11y) and in some stories I want to disable this tab. For example I have a simple component like input without label, so I don't need to see violations related to missing label. I tried to use disable option as in info addon (tab is empty there), but it doesn't seem to work:

.addParameters({
  a11y: {
    disable: true
  }
})
.addParameters({
  info: {
    disable: true
  }
})

and this code disables all rules not only in single story but in every one

.addParameters({
  a11y: {
    config: { // axe-core configurationOptions (https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#parameters-1)
      disableOtherRules: true
    }
  }
})

And going further I have a second question. How to pass specific axe rules for only a single story?

Expected behavior Hide or leave empty accessibility tab when disable: true option is passed

System:

stale[bot] commented 5 years ago

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

shilman commented 5 years ago

Whoopee!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-alpha.36 containing PR #6923 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

shilman commented 5 years ago

Ermahgerd!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.0-alpha.37 containing PR #7333 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.