Skip to content

Commit

Permalink
Merge pull request #1168 from City-of-Helsinki/HDS-2038-unify-visual-…
Browse files Browse the repository at this point in the history
…test-and-update-scripts

Hds 2038 unify visual test and update scripts
  • Loading branch information
Riippi authored Dec 1, 2023
2 parents ebc51f6 + dca362e commit 63c30bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- [Nvm](https://github.com/nvm-sh/nvm)
- [Node](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/)
- [Docker](https://www.docker.com/) (for visual regression tests)
- [Docker](https://www.docker.com/) (For visual regression tests. Read more [here](https://github.com/City-of-Helsinki/helsinki-design-system/blob/development/packages/react/DEVELOPMENT.md#visual-regression-tests).)

### Setting up local development environment

Expand Down
8 changes: 2 additions & 6 deletions packages/react/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,9 @@ To run the visual regression tests, you must first build the storybook by runnin

### Updating reference images

When adding a new component or after making visual changes to some existing component, you must update the corresponding reference image. Before you can do this, you must start the local react storybook by issuing the following command in the root of the whole project:
When adding a new component or after making visual changes to some existing component, you must update the corresponding reference image. Before you can do this, you must first build the storybook by running `yarn build-storybook`.

```bash
yarn start:react
```

Then leave the storybook on the background and switch to another terminal window. Go to packages/react and issue this command:
Then you can issue this command:

```bash
yarn update-reference-images --storiesFilter "<name or part of the name of the story>"
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"test": "jest --env=jest-environment-jsdom-sixteen",
"prepublishOnly": "cp -r ./lib/. .",
"visual-test": "loki test --requireReference --verboseRenderer --reactUri file:./storybook-static",
"update-reference-images": "loki update"
"update-reference-images": "loki update --requireReference --verboseRenderer --reactUri file:./storybook-static"
},
"devDependencies": {
"@babel/core": "7.11.6",
Expand Down

0 comments on commit 63c30bf

Please sign in to comment.