-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: added storybook, playwright and tests
- Loading branch information
Showing
43 changed files
with
11,262 additions
and
2,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Playwright Tests | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '.nvmrc' | ||
- name: Install dependencies | ||
run: npm install -g pnpm && pnpm install | ||
- name: Install Playwright Browsers | ||
run: pnpm exec playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: pnpm exec playwright test | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Storybook Tests | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: Install dependencies | ||
run: npm install -g pnpm && pnpm install | ||
- name: Install Playwright Browsers | ||
run: pnpm exec playwright install --with-deps | ||
- name: Build Storybook | ||
run: pnpm storybook:build --test --quiet | ||
- name: Serve Storybook and run tests | ||
run: | | ||
pnpx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | ||
"pnpx http-server storybook-static --port 6006 --silent" \ | ||
"pnpx wait-on tcp:6006 && pnpm storybook:test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Tailwind CSS breakpoints. | ||
* | ||
* @see https://tailwindcss.com/docs/responsive-design | ||
*/ | ||
export const TAILWIND_VIEWPORTS = { | ||
sm: { | ||
name: 'Small (sm)', | ||
styles: { | ||
width: '640px', | ||
height: '100%' | ||
} | ||
}, | ||
md: { | ||
name: 'Medium (md)', | ||
styles: { | ||
width: '768px', | ||
height: '100%' | ||
} | ||
}, | ||
lg: { | ||
name: 'Large (lg)', | ||
styles: { | ||
width: '1024px', | ||
height: '100%' | ||
} | ||
}, | ||
xl: { | ||
name: 'Extra Large (xl)', | ||
styles: { | ||
width: '1280px', | ||
height: '100%' | ||
} | ||
}, | ||
'2xl': { | ||
name: '2X Large (2xl)', | ||
styles: { | ||
width: '1536px', | ||
height: '100%' | ||
} | ||
} | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { StorybookConfig } from '@storybook/nextjs'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../src/components/**/*.stories.@(ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-onboarding', | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@chromatic-com/storybook', | ||
'@storybook/addon-interactions', | ||
'storybook-addon-pseudo-states' | ||
], | ||
framework: { | ||
name: '@storybook/nextjs', | ||
options: {} | ||
}, | ||
docs: { | ||
autodocs: 'tag' | ||
}, | ||
staticDirs: ['../public'] | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- in src/app/layout.tsx, the Inter font is loaded. With this preview-head.html file, the Inter font is applied to the Storybook preview. --> | ||
|
||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet" /> | ||
<style> | ||
body { | ||
font-family: "Inter", sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Preview } from '@storybook/react'; | ||
|
||
import '~/styles/tailwind.css'; | ||
import { TAILWIND_VIEWPORTS } from './constants'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i | ||
} | ||
}, | ||
viewport: { | ||
viewports: TAILWIND_VIEWPORTS | ||
} | ||
} | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.