design-system-react
design-system-react copied to clipboard
Test coverage for props
Create Abstract Syntax Tree plugin that parses stories source code and make sure that all component props listed within component/components-docs.json are called in AST of Storybook stories.
This should create 100% prop coverage to know if all props are used in Storybook stories. This does not mean that they all work correctly, but that they are all surfaced within Storybook.
Hi @interactivellama, I find the concept interesting and would like to work on this. Could you provide me with more info what do you mean by AST of Storybook stories.
For an existing AST plugin see @futuremint 's https://github.com/salesforce/design-system-react/blob/master/scripts/code/find-and-fix-missing-doc-stories.js plugin which analyzes what stories are in the site-stories arrays.
The other place to look for inspiration is https://github.com/reactjs/react-docgen which we current use to generate https://github.com/salesforce/design-system-react/blob/master/components/component-docs.json
As for storybook stories, that's all these http://design-system-react-components.herokuapp.com/?selectedKind=SLDSAccordion&selectedStory=Base&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybook%2Factions%2Factions-panel in the left column sidebar.