design-system-react icon indicating copy to clipboard operation
design-system-react copied to clipboard

Test coverage for props

Open interactivellama opened this issue 6 years ago • 2 comments

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.

interactivellama avatar Feb 23 '19 00:02 interactivellama

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.

imshubhamsingh avatar Mar 15 '19 14:03 imshubhamsingh

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.

interactivellama avatar Mar 28 '19 05:03 interactivellama