eSales UI-Components Library
This library should be a collection of reusable components built with React & Typescript, based on AXAs own Pattern library
Demo of available components is published on github pages and updated with each commit: Storybook Demo
How to use
-
Download the latest version from npmjs.org:
npm i @axa-ch/esales-ui-components
or
yarn add @axa-ch/esales-ui-components
-
use it in the code:
import { AxaButton } from '@axa-ch/esales-ui-components';
Testing
For testing we are using Jest with Storybook addon for snapshot testing
All configurations for testing can be found in jest.config.js
file as well as .jest
, __mocks__
and .storybook
folders.
To start tests just run the command. This will include both unit and snapshot tests.
npm run test:silent
-
Snapshot testing
-
Tests are automatically generated once the story for component is added
-
If you have changed component snapshot tests will fail, in order to remedy this you need to update snapshots and commit it to the github
npm run test:silent -- -u
-
-
Unit testing
- We are using testing-library so please check out examples and api references in order to fully utilize this lib
How to contribute
- Clone this repository
- Install all dependencies
npm install
- Spin-up storybook and start hacking:
npm run storybook
- Check out our "How to document" readme