Remove and cleanup storybook testing

This commit is contained in:
adilallo
2026-01-28 14:14:40 -07:00
parent 7ea724a8d9
commit 6de3a07811
8 changed files with 14 additions and 47 deletions
+2 -4
View File
@@ -486,10 +486,8 @@ jobs:
with: { node-version: 20 }
- run: npm ci
- run: npm run storybook:build:github
# Temporarily disabled - test-runner needs updates for Storybook 10.x compatibility
# Will be re-enabled once test-runner compatibility issues are resolved
# - run: npm run test:sb
# env: { CI: true }
# Storybook is used for component documentation only.
# Component tests (tests/components/*.test.tsx) provide all test coverage.
lint:
runs-on: [self-hosted, macos-latest]
+3 -3
View File
@@ -23,6 +23,7 @@ npm-cache/
# Lighthouse CI results
/lhci-results/
/.lighthouseci/
# Ignore other image files (but not visual regression snapshots)
*.png
@@ -76,9 +77,8 @@ next-env.d.ts
*storybook.log
storybook-static
# storybook config files (to avoid git changes when switching between local and production)
.storybook/main.js
.storybook/preview.js
# Storybook build output (config files should be committed)
storybook-static
# Gitea runner runtime files
.runner
-33
View File
@@ -1,33 +0,0 @@
module.exports = {
// Test runner configuration
testMatch: ["**/*.stories.@(js|jsx|ts|tsx)"],
testTimeout: 30000,
retries: 2,
// Fix for the StorybookTestRunnerError initialization issue
setupFilesAfterEnv: [
"<rootDir>/node_modules/@storybook/test-runner/jest-setup.js",
],
// Ensure proper module resolution
moduleNameMapping: {
"^@/(.*)$": "<rootDir>/app/$1",
},
// Test environment configuration
testEnvironment: "jsdom",
// Transform configuration
transform: {
"^.+\\.(js|jsx|ts|tsx)$": [
"babel-jest",
{ presets: ["@babel/preset-env", "@babel/preset-react"] },
],
},
// Module file extensions
moduleFileExtensions: ["js", "jsx", "ts", "tsx", "json"],
// Ignore patterns
testPathIgnorePatterns: ["/node_modules/", "/.next/"],
// Coverage configuration
collectCoverageFrom: [
"app/**/*.{js,jsx,ts,tsx}",
"!app/**/*.d.ts",
"!app/**/*.stories.{js,jsx,ts,tsx}",
],
};
-1
View File
@@ -147,7 +147,6 @@ The Storybook configuration automatically detects the environment:
- `npm run e2e:ui` - Run E2E tests with UI
- `npm run e2e:serve` - Start dev server and run E2E tests
- `npm run lhci` - Run performance tests
- `npm run test:sb` - Run Storybook tests
### Storybook
-3
View File
@@ -1,3 +0,0 @@
// Mock CSS imports for tests
// This prevents jsdom from trying to parse Tailwind CSS v4 syntax
export default {};
+9
View File
@@ -190,6 +190,15 @@ describe("Input behaviour specifics", () => {
npm run visual:test
```
### Storybook
**Storybook is used for component documentation and visual review only.** It is not used for automated testing.
- Component tests (`tests/components/*.test.tsx`) provide all test coverage previously handled by Storybook test-runner
- Storybook stories (`stories/*.stories.js`) serve as living documentation and visual examples
- Interaction functions are inlined in story files for demonstration purposes
- Run Storybook locally with `npm run storybook` for component development and review
### Accessibility Testing
Accessibility is tested at two levels:
-2
View File
@@ -18,7 +18,6 @@
"test:watch": "vitest",
"test:ui": "vitest --ui",
"test:component": "vitest run tests/components",
"test:sb": "storybook dev -p 6006 & wait-on http://localhost:6006 && test-storybook --url http://localhost:6006",
"e2e": "playwright test",
"test:e2e": "playwright test",
"e2e:ui": "playwright test --ui",
@@ -64,7 +63,6 @@
"@storybook/addon-a11y": "^10.2.0",
"@storybook/addon-interactions": "^8.6.14",
"@storybook/nextjs": "^10.2.0",
"@storybook/test-runner": "^0.24.2",
"@svgr/webpack": "^8.1.0",
"@tailwindcss/postcss": "^4.1.11",
"@testing-library/jest-dom": "^6.8.0",
-1
View File
@@ -32,7 +32,6 @@ export default defineConfig({
"tests/e2e/**/*.e2e.test.{js,jsx,ts,tsx}",
],
exclude: [
"tests/e2e/**/*.storybook.test.{js,jsx,ts,tsx}",
"tests/e2e/**/*.spec.{js,jsx,ts,tsx}",
],
// Disable CSS processing in tests to avoid jsdom parsing errors with Tailwind v4