Skip to content

Latest commit

 

History

History

sample-component

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Sample Component Breadcrumbs

This is a private sample package, showing the basics on contributing a HIG component.

This component accepts Text-Link & Typography as its child nodes, and displays them in a "breadcrumbs" style.


Getting started

Instruction

package.json

HIG components should implement similar package.json file as showning in this sample component, to get the consistent configrations, building, testing processes in HIG.

Component export

Each package should have at least one export of the component, in this sample package, we export component SampleComponentBreadcrumbs in src/index.js. We can also have more exports for constants, sub-components, etc.

Storybook preview

HIG uses storybook to preview components. Each component package should put its stories in *.stories.js file in src/__stories__/ folder, and the stories will be included in storybook automatically.

Unit testing

Jest along with Enzyme is used to run the unit testing. In this sample package, we implement the unit test in SampleComponentBreadcrumbs.test.js, and snapshots are stored in src/__snapshots__.

Visual regression testing

HIG runs visual regression tests via Gemini. Each component package should put the gemini test files in src/__gemini__ folder, and the tests will be included in HIG visual tests suite automatically.