emulsify-ds / emulsify-drupal

Drupal theme built with Storybook and Webpack
GNU General Public License v2.0
92 stars 42 forks source link

Automate component accessibility testing #151

Closed sync-by-unito[bot] closed 2 years ago

sync-by-unito[bot] commented 4 years ago

Now that the Storybook 6 update is merged, we should look into automating this component list.

┆Issue is synchronized with this Jira Story by Unito

philwolstenholme commented 3 years ago

I wrote some code on a Vue project to get Storybook to output a JSON file containing a list of stories. I remember the documentation around the feature was a bit weak but I could find the work I did and share it here if that would be useful?

ModulesUnraveled commented 3 years ago

@philwolstenholme that would be fantastic!

philwolstenholme commented 3 years ago

Here you go @ModulesUnraveled:

as an npm script:

  scripts: {
      "storybook:generate-stories-file": "npx sb extract ./storybook ./storybook/stories.json",
  }

That will read from the Storybook configured in the ./storybook directory and output a JSON list of stories to ./storybook/stories.json.

The documentation is a bit hidden away in the 'Storybook composition' section of the docs: https://storybook.js.org/docs/react/workflows/storybook-composition#improve-your-storybook-composition

calebtr-metro commented 2 years ago

I discussed with @ModulesUnraveled and am closing this issue in favor of moving it to the compound project at https://github.com/emulsify-ds/compound/issues/42.