Skip to content
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

Storybook smoke test does not catch if individual stories are broken #2219

Closed
sarayourfriend opened this issue May 30, 2023 · 2 comments · Fixed by #4265
Closed

Storybook smoke test does not catch if individual stories are broken #2219

sarayourfriend opened this issue May 30, 2023 · 2 comments · Fixed by #4265
Assignees
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend 🔧 tech: playwright Involves Playwright

Comments

@sarayourfriend
Copy link
Collaborator

Problem

See #2218 #2217 #2216 #2215 for examples of broken stories.

Description

All of these could be prevented either by type-checking the stories (impossible due to MDX not supporting TypeScript and our previous commitment to MDX in spite of this for the sake of the description pages for stories, discussion here: #584; also hindered by some components not being typed) or by writing a basic Playwright test for every single story (perhaps one that simply iterates through them all) to confirm there is no warning and that the story at least runs.

The latter is the only reasonable option in light of our commitment to MDX (a lot of work went into converting stories already) and that some of the components in the broken stories above aren't typed anyway (though it would work for many of our stories that do render typed components).

The solution for this is, therefore: write a Storybook playwright test to iterate through all the stories and confirm that no errors are rendered to the page. Note that storybook sometimes still renders something from the story underneath and overlays the error, so it is not enough to merely confirm that there is content from the story. The test must check that there is no error overlay.

@sarayourfriend sarayourfriend added 🟧 priority: high Stalls work on the project or its dependents ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository 🧱 stack: frontend Related to the Nuxt frontend labels May 30, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Openverse Backlog May 30, 2023
@dhruvkb
Copy link
Member

dhruvkb commented May 30, 2023

There is an issue to add TS support to MDX (microsoft/TypeScript#36440). Storybook v7 comes with MDX v2 (#2169), which supports IntelliSense (experimental).

"mdx.experimentalLanguageServer": true

@dhruvkb dhruvkb added 🟨 priority: medium Not blocking but should be addressed soon and removed 🟧 priority: high Stalls work on the project or its dependents labels Sep 26, 2023
@obulat obulat added help wanted Open to participation from the community 🔧 tech: playwright Involves Playwright labels Oct 20, 2023
@obulat obulat moved this from 📋 Backlog to 🏗 In Progress in Openverse Backlog May 5, 2024
@zackkrida
Copy link
Member

Noting here that Storybook 8 no longer supports MDX and offers a guide for converting stories:

https://storybook.js.org/docs/migration-guide#storiesmdx-to-mdxcsf

@openverse-bot openverse-bot moved this from 🏗 In Progress to ✅ Done in Openverse Backlog May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend 🔧 tech: playwright Involves Playwright
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants