-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into fix/pagination-api-align
- Loading branch information
Showing
24 changed files
with
2,926 additions
and
252 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -17,4 +17,3 @@ jobs: | |
run: yarn biome ci . | ||
- name: Lint CSS | ||
run: yarn lint-style | ||
|
This file was deleted.
Oops, something went wrong.
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,61 @@ | ||
name: Test | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- 'packages/**' | ||
- 'apps/storybook/**' | ||
|
||
permissions: | ||
checks: write | ||
# Required to put a comment into the pull-request | ||
pull-requests: write | ||
|
||
jobs: | ||
checks: | ||
name: Build & test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/gh-setup | ||
- name: Build | ||
run: yarn build | ||
- name: Types | ||
run: yarn types:react | ||
- name: Test | ||
run: yarn test | ||
- name: 'Report Coverage' | ||
if: success() || failure() | ||
uses: davelosert/vitest-coverage-report-action@v2 | ||
- name: Publish unit test report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: success() || failure() | ||
with: | ||
report_paths: 'test-report.xml' | ||
detailed_summary: true | ||
check_name: Unit Test Report | ||
check_annotations: true | ||
check_title_template: '{{FILE_NAME}} / {{TEST_NAME}}' | ||
- name: Install Playwright | ||
run: npx playwright install --with-deps | ||
- name: Build storybook | ||
run: yarn build:storybook | ||
- name: Run Storybook tests | ||
run: yarn test:storybook | ||
- name: Replace relative paths in test report | ||
uses: jacobtomlinson/gha-find-replace@v3 | ||
if: success() || failure() | ||
with: | ||
include: 'apps/storybook/test-report.xml' | ||
find: '../../' | ||
replace: '' | ||
regex: false | ||
- name: Publish Storybook test report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: success() || failure() | ||
with: | ||
report_paths: 'apps/storybook/test-report.xml' | ||
detailed_summary: true | ||
check_name: Storybook Test Report | ||
check_annotations: true | ||
check_title_template: '{{FILE_NAME}} / {{TEST_NAME}}' |
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 |
---|---|---|
|
@@ -35,3 +35,6 @@ coverage/ | |
|
||
# Typescript | ||
next-env.d.ts | ||
|
||
# jest/vitest test reports | ||
test-report.xml |
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,50 @@ | ||
import { type TestRunnerConfig, getStoryContext } from '@storybook/test-runner'; | ||
import { checkA11y, configureAxe, injectAxe } from 'axe-playwright'; | ||
|
||
/* | ||
* See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api | ||
* to learn more about the test-runner hooks API. | ||
*/ | ||
|
||
const config: TestRunnerConfig = { | ||
// Tags to include, exclude, or skip. These tags are defined as annotations in your story or meta. | ||
tags: { | ||
exclude: [], | ||
}, | ||
async preVisit(page) { | ||
await injectAxe(page); | ||
}, | ||
async postVisit(page, context) { | ||
// Get the entire context of a story, including parameters, args, argTypes, etc. | ||
const storyContext = await getStoryContext(page, context); | ||
|
||
/* | ||
* Accessibility testing | ||
*/ | ||
|
||
await configureAxe(page, { | ||
// Apply story-level a11y rules | ||
rules: storyContext.parameters?.a11y?.config?.rules, | ||
}); | ||
|
||
const isA11yDisabled = storyContext.parameters?.a11y?.disable === true; | ||
if (!isA11yDisabled) { | ||
await checkA11y( | ||
page, | ||
'#storybook-root', | ||
{ | ||
detailedReport: true, | ||
detailedReportOptions: { | ||
html: true, | ||
}, | ||
verbose: false, | ||
axeOptions: {}, | ||
}, | ||
false, | ||
'v2', | ||
); | ||
} | ||
}, | ||
}; | ||
|
||
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
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
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.