Skip to content

New Component Checklist

Jenna Badanowski edited this page May 5, 2020 · 3 revisions

Steps for creating a new component: "Component"

  1. Create new Component directory under src
  2. In src/Component create Component.js file
    • component logic should be here
    • import appropriate styles from fundamental-styles- no styles should be created inside of fundamental-react
    • add JSDoc comment at the top the file describing the component (this will appear on the documentation website)
    • add JSDoc comments for each propType (these will appear on the documentation website)
  3. In src/Component create Component.test.js file
    • add unit tests using Jest and Enzyme
    • See Testing Guidefor more information
  4. In src/Component create __stories__/Component.stories.js
  5. Run npm run lint
    • If this command fails, run npm run lint:fix, fix other errors manually.
  6. Run npm run size
    • If this command fails, edit the .size-limit file at the root of the repository
  7. Run npm run test:storybook:update
    • This command will take screenshots of your new stories and add them to visual-regression-testing/__image_snapshots__/ and will take jest snapshots of your new stories and add them to src/Component/__stories__/__snapshots__/
Clone this wiki locally