We welcome all types of contribution.
Need a feature or found a bug? Please create an issue.
Want to contribute by creating a pull request? Great! Fork iTwinUI-layouts to get started.
To clone and build iTwinUI-layouts, you'll need Git and Yarn 3 installed on your computer.
- Create a local clone of your forked repository. You can do this from the command line or using the Github Desktop app.
- Go to the directory where you cloned iTwinUI. e.g.
cd iTwinUI-layouts
. - Run
yarn install
from that directory.
yarn start
yarn test
Before running this command, make sure Docker is running.
yarn test:approve
For running tests you will need Docker. It helps to avoid cross-platform rendering differences. We are using cypress for running tests and making screenshots.
- If you get
ENOENT: no such file or directory
orEPERM: operation not permitted
then you need to open Docker Desktop -> Settings -> General -> DisableUse the WSL 2 based engine
setting. - To check failed tests results, open
demo/cypress-visual-report/cypress-visual-report.html
in your browser. You may want to use a local HTTP server (e.g. with the Live Server extension). - When writing tests, use
layoutsDescribe
instead of regulardescribe
. This way tests will be run on different screen sizes. - To make a screenshot, use
cy.compareSnapshot(...)
. - Example test:
layoutDescribe('PageLayoutDemo', (screenSize) => { it('should render PageLayoutDemo', () => { cy.visit('page-layout'); cy.compareSnapshot(`basic-${screenSize.width}x${screenSize.height}`); }); });