Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Commit e92c73e

Browse files
authored
feat: integrate testing framework and add test cases (#2)
* feat: integrate testing framework and add test cases for SuperDocESign component - Added Vitest as the testing framework and configured test scripts in package.json. - Implemented test cases for the SuperDocESign component, covering rendering, state management, and audit trail functionality. - Updated Vite configuration to support testing with jsdom environment. - Enhanced GitHub workflows to include testing in PR validation and release processes. * chore: add commitlint configuration for conventional commit messages * chore: add @commitlint/config-conventional to devDependencies * chore: update commitlint configuration to enforce line length rules for body and footer * chore: add @commitlint/cli to devDependencies and update GitHub workflow to use pnpm exec for commitlint * chore: update commitlint configuration to include header-max-length rule
1 parent 69a9403 commit e92c73e

12 files changed

Lines changed: 2170 additions & 417 deletions

File tree

.github/workflows/pr-validation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ jobs:
3737

3838
- name: Validate commits
3939
run: |
40-
pnpm dlx commitlint \
40+
pnpm exec commitlint \
4141
--from ${{ github.event.pull_request.base.sha }} \
4242
--to ${{ github.event.pull_request.head.sha }}
4343
4444
- run: pnpm lint
4545
- run: pnpm build
46+
- run: pnpm test

.github/workflows/release-package.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141

4242
- run: pnpm install --frozen-lockfile
4343
- run: pnpm build
44+
- run: pnpm test
4445

4546
- name: Release
4647
id: release

commitlint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'body-max-line-length': [0, 'always'],
5+
'footer-max-line-length': [0, 'always'],
6+
'header-max-length': [0, 'always'],
7+
},
8+
};
9+

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
"type-check": "tsc --noEmit",
2424
"lint": "eslint src --ext .ts,.tsx",
2525
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
26+
"test": "vitest",
27+
"test:watch": "vitest --watch",
2628
"prepare": "husky",
2729
"release": "semantic-release",
2830
"check:all": "pnpm run type-check && pnpm run lint && pnpm run format"
@@ -55,9 +57,14 @@
5557
"superdoc": "^0.22.0"
5658
},
5759
"devDependencies": {
60+
"@commitlint/cli": "^20.1.0",
61+
"@commitlint/config-conventional": "^20.0.0",
5862
"@eslint/js": "^9.36.0",
5963
"@semantic-release/changelog": "^6.0.3",
6064
"@semantic-release/git": "^10.0.1",
65+
"@testing-library/jest-dom": "^6.9.1",
66+
"@testing-library/react": "^16.3.0",
67+
"@testing-library/user-event": "^14.6.1",
6168
"@types/node": "^24.5.2",
6269
"@types/react": "^19.2.2",
6370
"@types/react-dom": "^19.2.1",
@@ -66,14 +73,16 @@
6673
"eslint-plugin-react": "^7.37.5",
6774
"eslint-plugin-react-hooks": "^6.1.0",
6875
"husky": "^9.1.7",
76+
"jsdom": "^27.0.0",
6977
"prettier": "^3.6.2",
7078
"react": "^19.2.0",
7179
"react-dom": "^19.2.0",
7280
"semantic-release": "^24.2.9",
7381
"typescript": "^5.9.2",
7482
"typescript-eslint": "^8.44.1",
7583
"vite": "^7.1.7",
76-
"vite-plugin-dts": "^4.5.4"
84+
"vite-plugin-dts": "^4.5.4",
85+
"vitest": "^3.2.4"
7786
},
7887
"publishConfig": {
7988
"access": "public"

0 commit comments

Comments
 (0)