You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users can define custom HTML files to inject scripts/style in Storybook's preview by adding a .storybook/preview-head.html or .storybook/preview-body.html file. This is automatically loaded in Storybook, but ignored in the Vitest plugin.
💡 Solutions/Action items:
We can leverage the browser.testerHtmlPath to inject an HTML file into the test run, so that property could be automatically added internally via the Vitest plugin:
This solution however only allows for a single file to be added. We could instead read the contents of these preview html files and leverage the [transformIndexHtml](https://vite.dev/guide/api-plugin#transformindexhtml) plugin hook as mentioned in the previous section to inject them into the test run.
The text was updated successfully, but these errors were encountered:
Related to #29775
Users can define custom HTML files to inject scripts/style in Storybook's preview by adding a
.storybook/preview-head.html
or.storybook/preview-body.html
file. This is automatically loaded in Storybook, but ignored in the Vitest plugin.💡 Solutions/Action items:
We can leverage the
browser.testerHtmlPath
to inject an HTML file into the test run, so that property could be automatically added internally via the Vitest plugin:This solution however only allows for a single file to be added. We could instead read the contents of these preview html files and leverage the [transformIndexHtml](https://vite.dev/guide/api-plugin#transformindexhtml) plugin hook as mentioned in the previous section to inject them into the test run.
The text was updated successfully, but these errors were encountered: