Skip to content

Commit

Permalink
[Closes #465] Adds storybook testing to ci pipeline (#477)
Browse files Browse the repository at this point in the history
* feat: EditStudenModal refactor into component + storybook + storybook testing

* fix: storybook tests

* feat: run storybook tests on pr/branch pushes

* fix: node version

* fix: ci

* fix: ci

* fix: test was failing, deleting for now

* fix: lint + type check

* Remove deprecated actions.argTypesRegex

* Use setup-node@v4 in entire file

---------

Co-authored-by: Francis Li <francisli@users.noreply.github.com>
Co-authored-by: Francis Li <mail@francisli.com>
  • Loading branch information
3 people authored Dec 6, 2024
1 parent 468d818 commit bebb8c3
Show file tree
Hide file tree
Showing 8 changed files with 14,028 additions and 4,740 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
Expand All @@ -54,3 +54,24 @@ jobs:
run: docker pull postgres:15
- name: Run tests
run: npm run test

storybook-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Build Storybook
run: npm run build:storybook --quiet
- name: Serve Storybook and run tests
run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --port 6006 --silent" \
"npx wait-on tcp:127.0.0.1:6006 && npm run test-storybook"
1 change: 0 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import "../src/styles/globals.css";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down
Loading

0 comments on commit bebb8c3

Please sign in to comment.