feat(core-ui): add jsdom Vitest config + RTL tests for components

Adopts jsdomVitestConfig from @repo/core-typescript. Adds
@testing-library/react, @testing-library/user-event, jsdom devDeps.
Writes smoke + interaction tests for every atom/molecule/organism/template
using renderWithProviders from @repo/core-testing/react.

Components covered:
- atoms: Button (5 tests), Input (4), Label (2)
- molecules: FormField (5)
- organisms / templates: empty barrels, no components

Adjustments:
- core-ui/tsconfig.json now extends react-library.json (jsx: react-jsx)
  with rootDir "." + paths {"@/*"} + types [vitest/globals, jest-dom]
- core-typescript/vitest.base.jsdom.ts uses ./vitest.base.node.ts (explicit
  .ts extension) so Node's ESM resolver finds the source file when loaded
  via the package export from a downstream package

Spec: §6.1, §6.5

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-05 16:21:58 +02:00
parent b3c903fd36
commit 11b5b15105
9 changed files with 165 additions and 7 deletions

View File

@@ -1,10 +1,12 @@
{
"extends": "@repo/core-typescript/base.json",
"extends": "@repo/core-typescript/react-library.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"lib": ["ES2022", "DOM"],
"jsx": "preserve"
"rootDir": ".",
"types": ["vitest/globals", "@testing-library/jest-dom"],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/*.stories.tsx", "**/*.stories.ts"]