fix: add testing-library/jest-dom matchers for UI tests

- Add @testing-library/jest-dom as dev dependency
- Create test-setup.ts to import jest-dom matchers
- Configure Vitest to use setup file
- All UI package tests now passing

Fixes test failures with toHaveTextContent and other DOM matchers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ajax Davis 2025-11-25 22:22:35 +10:00
parent 03021682ce
commit 4f81564c49
3 changed files with 4 additions and 1 deletions

View file

@ -32,10 +32,11 @@
"@tpmjs/utils": "workspace:*"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@tpmjs/eslint-config": "workspace:*",
"@tpmjs/test": "workspace:*",
"@tpmjs/tsconfig": "workspace:*",
"@testing-library/react": "^16.3.0",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"happy-dom": "^15.11.7",

View file

@ -0,0 +1 @@
import '@testing-library/jest-dom/vitest';

View file

@ -4,5 +4,6 @@ export default defineConfig({
test: {
globals: true,
environment: 'happy-dom',
setupFiles: ['./src/test-setup.ts'],
},
});