Skip to content

Commit b9671fb

Browse files
committed
Add Chromatic visual regression tests for UI component
1 parent bab74c1 commit b9671fb

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.github/workflows/chromatic.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# name of our action
2+
name: "Chromatic Deployment"
3+
# the event that will trigger the action
4+
on: push
5+
6+
# what the action will do
7+
jobs:
8+
test:
9+
# the operating system it will run on
10+
runs-on: ubuntu-latest
11+
# the list of steps that the action will go through
12+
steps:
13+
- uses: actions/checkout@v1
14+
- run: yarn
15+
- uses: chromaui/action@v1
16+
# options required to the GitHub Chromatic action
17+
with:
18+
# Chromatic projectToken, see https://storybook.js.org/tutorials/visual-testing-handbook/react/en/automate/ to obtain it
19+
projectToken: 385f9df90462
20+
token: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@types/react": "^18.0.28",
2828
"@types/react-dom": "^18.0.11",
2929
"@vitejs/plugin-react": "^4.0.0-beta.0",
30+
"chromatic": "^10.1.0",
3031
"eslint": "^8.38.0",
3132
"eslint-plugin-react": "^7.32.2",
3233
"eslint-plugin-react-hooks": "^4.6.0",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3453,6 +3453,11 @@ chownr@^2.0.0:
34533453
resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
34543454
integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==
34553455

3456+
chromatic@^10.1.0:
3457+
version "10.1.0"
3458+
resolved "https://registry.yarnpkg.com/chromatic/-/chromatic-10.1.0.tgz#d82f3045c297fb9a2d752aa1322d5fdb2cd3fd78"
3459+
integrity sha512-S+ztO8f1k/LckuzJKCqaTs6AfUQ0eLNT9kEoyCUwX7gkJnveQo5JStCfY55v30zogjRkHJpwqzEfSXl6AwO2tQ==
3460+
34563461
ci-info@^3.2.0:
34573462
version "3.9.0"
34583463
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4"

0 commit comments

Comments
 (0)