Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add storybook testing setup for client #8335

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
01a87c1
add storybook testing setup for client
rikukissa Jan 15, 2025
1ae11ec
add an example of testing a legacy component in storybook, CI job
rikukissa Jan 17, 2025
ee66373
Update packages/client/src/v2-events/features/events/fixtures.ts
rikukissa Jan 17, 2025
d2886ab
Merge branch 'develop' into events-v2-storybook
rikukissa Jan 17, 2025
dbc3f20
add missing license headers
rikukissa Jan 17, 2025
743b37b
fix storybook path
rikukissa Jan 17, 2025
1f134b5
Merge branch 'events-v2-storybook' of github.com:opencrvs/opencrvs-co…
rikukissa Jan 17, 2025
65b0f06
use different option
rikukissa Jan 17, 2025
657fdd6
make visual tests its own separate testing phase
rikukissa Jan 17, 2025
2d66a9d
download full git history
rikukissa Jan 17, 2025
0d1f0b8
add missing header
rikukissa Jan 17, 2025
a923f3e
do fetch with github token
rikukissa Jan 17, 2025
b81e4cd
fix type errors
rikukissa Jan 17, 2025
9abb368
remove import asserts
rikukissa Jan 17, 2025
11a6f41
fix some type errors
rikukissa Jan 17, 2025
88b0daf
Merge branch 'develop' of github.com:opencrvs/opencrvs-core into even…
rikukissa Jan 17, 2025
494525d
fix type error
rikukissa Jan 17, 2025
608736e
fix type error
rikukissa Jan 17, 2025
89b3406
use https url for core repo
rikukissa Jan 17, 2025
f77ee76
install storybook plugins for eslint
rikukissa Jan 17, 2025
458232b
remove storybook eslint plugin for now, for whatever reason yarn just…
rikukissa Jan 17, 2025
01fd9a9
use github toke n to fetch repo
rikukissa Jan 17, 2025
475534b
cleanup
rikukissa Jan 17, 2025
3dd464b
fix linter issues
rikukissa Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,52 @@ jobs:
- name: Run linting
run: cd packages/client && yarn lint

run-visual-tests:
name: Run visual tests
needs: prepare-client-tests
runs-on: ubuntu-22.04

steps:
- name: Download filesystem artifact
uses: actions/[email protected]
with:
name: client
path: .

- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Cache Node.js dependencies
uses: actions/cache@v4
with:
path: |
**/node_modules
~/.cache/yarn/v6
key: node-${{ hashFiles('**/yarn.lock', format('{0}/{1}','packages/client','package.json')) }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
run: CI="" yarn install --frozen-lockfile

# Without this, the fetch command will fail with
# fatal: could not read Username for 'https://github.com': No such device or address
- name: Remove extraheader config
run: git config --unset http.https://github.com/.extraheader

- name: Fetch full Git history
run: git fetch --prune --unshallow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Chromatic
uses: chromaui/action@latest
with:
workingDir: packages/client
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

test-client:
name: Test client
needs: prepare-client-tests
Expand Down
3 changes: 3 additions & 0 deletions license-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"backups",
"**/coverage",
"packages/client/public/robots.txt",
"packages/client/public/mockServiceWorker.js",
"packages/login/public/robots.txt",
".env*",
".vs",
Expand All @@ -36,6 +37,8 @@
"packages/components/.storybook/preview.jsx",
"packages/components/.storybook/manager-head.html",
"grafana",
"packages/client/storybook-static",
"packages/client/.storybook/preview-head.html",
"packages/scheduler/start.sh",
"packages/scheduler/crontab",
"packages/scheduler/jobs/*",
Expand Down
3 changes: 2 additions & 1 deletion packages/client/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# dependencies
/node_modules
/node_modules
!.storybook
3 changes: 3 additions & 0 deletions packages/client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ src/i18n/locales/en.csv
graphql.schema.json
.lh
.idea

*storybook.log
storybook-static
Loading
Loading