diff --git a/.gitignore b/.gitignore index 832800f1..01ebf95f 100644 --- a/.gitignore +++ b/.gitignore @@ -48,7 +48,12 @@ Thumbs.db # Generated output out/ screenshots-echo-diag/ -tools/remotion/out/ +scripts/remotion/out/ + +# Artifacts that should not be tracked +test-results/ +tmp/ +public # Claude Code plan tracking plan.json diff --git a/.prettierignore b/.prettierignore index 7ac646ba..c3cf1aa4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -6,4 +6,4 @@ src/web/public/app.js src/web/public/styles.css src/web/public/mobile.css src/web/public/index.html -tools/ +scripts/remotion/ diff --git a/CLAUDE.md b/CLAUDE.md index 2140f3bb..5cd778b3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -80,7 +80,7 @@ Codeman is a Claude Code session manager with web interface and autonomous Ralph **CI**: `.github/workflows/ci.yml` runs `typecheck`, `lint`, `format:check` on push to master/main and on PRs (Node 22). Tests excluded (they spawn tmux). -**Code style**: Prettier (`singleQuote: true`, `printWidth: 120`, `trailingComma: "es5"`). ESLint flat config (`eslint.config.js`) allows `no-console`, warns on `@typescript-eslint/no-explicit-any`. Ignores: `app.js`, `scripts/**/*.mjs`, `src/web/public/vendor/**`, `tools/**`, `remotion/**`. +**Code style**: Prettier (`singleQuote: true`, `printWidth: 120`, `trailingComma: "es5"`). ESLint flat config (`config/eslint.config.js`) allows `no-console`, warns on `@typescript-eslint/no-explicit-any`. Ignores: `app.js`, `scripts/**/*.mjs`, `src/web/public/vendor/**`, `scripts/remotion/**`. ## Common Gotchas @@ -136,7 +136,7 @@ Codeman is a Claude Code session manager with web interface and autonomous Ralph **Hook events**: Claude Code hooks trigger via `/api/hook-event`. Key events: `permission_prompt`, `elicitation_dialog`, `idle_prompt`, `stop`, `teammate_idle`, `task_completed`. See `src/hooks-config.ts`. -**Agent Teams**: `TeamWatcher` polls `~/.claude/teams/`, matches to sessions via `leadSessionId`. Teammates are in-process threads appearing as subagents. Enable: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`. See `agent-teams/`. +**Agent Teams**: `TeamWatcher` polls `~/.claude/teams/`, matches to sessions via `leadSessionId`. Teammates are in-process threads appearing as subagents. Enable: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`. See `docs/agent-teams/`. **Circuit breaker**: Prevents respawn thrashing. States: `CLOSED` → `HALF_OPEN` → `OPEN`. Reset: `/api/sessions/:id/ralph-circuit-breaker/reset`. @@ -204,7 +204,7 @@ npx vitest run -t "pattern" # By name (SAFE) **Ports**: Pick unique ports manually. Search `const PORT =` before adding new tests. -**Respawn tests**: Use `MockSession` from `test/respawn-test-utils.ts`. **Route tests**: `app.inject()` in `test/routes/`. **Mobile tests**: Playwright suite in `mobile-test/` (135 device profiles). +**Respawn tests**: Use `MockSession` from `test/respawn-test-utils.ts`. **Route tests**: `app.inject()` in `test/routes/`. **Mobile tests**: Playwright suite in `test/mobile/` (135 device profiles). ## Screenshots @@ -226,7 +226,7 @@ Target: 20 sessions, 50 agent windows at 60fps. Limits in `src/config/`: termina ## References -Deep-dive docs in `docs/`: `respawn-state-machine.md`, `ralph-wiggum-guide.md`, `claude-code-hooks-reference.md`, `terminal-anti-flicker.md`, `opencode-integration.md`, `qr-auth-plan.md`, `orchestrator-loop-architecture.md`, `browser-testing-guide.md`. Agent Teams: `agent-teams/README.md`. SSE events: `src/web/sse-events.ts` + `constants.js`. +Deep-dive docs in `docs/`: `respawn-state-machine.md`, `ralph-wiggum-guide.md`, `claude-code-hooks-reference.md`, `terminal-anti-flicker.md`, `opencode-integration.md`, `qr-auth-plan.md`, `orchestrator-loop-architecture.md`, `browser-testing-guide.md`. Agent Teams: `docs/agent-teams/README.md`. SSE events: `src/web/sse-events.ts` + `constants.js`. ## Scripts diff --git a/eslint.config.js b/config/eslint.config.js similarity index 94% rename from eslint.config.js rename to config/eslint.config.js index 4d594b25..05ffba98 100644 --- a/eslint.config.js +++ b/config/eslint.config.js @@ -22,8 +22,7 @@ export default tseslint.config( 'src/web/public/vendor/**', 'src/web/public/app.js', 'scripts/**/*.mjs', - 'tools/**', - 'remotion/**', + 'scripts/remotion/**', ], } ); diff --git a/vitest.config.ts b/config/vitest.config.ts similarity index 87% rename from vitest.config.ts rename to config/vitest.config.ts index 874b7f75..48ecb9c2 100644 --- a/vitest.config.ts +++ b/config/vitest.config.ts @@ -1,7 +1,11 @@ +import { resolve } from 'node:path'; import { defineConfig } from 'vitest/config'; +const root = resolve(import.meta.dirname, '..'); + export default defineConfig({ test: { + root, globals: true, environment: 'node', include: ['test/**/*.test.ts'], diff --git a/agent-teams/README.md b/docs/agent-teams/README.md similarity index 100% rename from agent-teams/README.md rename to docs/agent-teams/README.md diff --git a/agent-teams/design.md b/docs/agent-teams/design.md similarity index 100% rename from agent-teams/design.md rename to docs/agent-teams/design.md diff --git a/agent-teams/experiment-log.md b/docs/agent-teams/experiment-log.md similarity index 100% rename from agent-teams/experiment-log.md rename to docs/agent-teams/experiment-log.md diff --git a/package.json b/package.json index 6c3d2cca..42bfe289 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,12 @@ "dev": "tsx src/index.ts web", "web": "node dist/index.js web", "clean": "rm -rf dist", - "test": "vitest run", - "test:watch": "vitest", - "test:coverage": "vitest run --coverage", + "test": "vitest run --config config/vitest.config.ts", + "test:watch": "vitest --config config/vitest.config.ts", + "test:coverage": "vitest run --config config/vitest.config.ts --coverage", "typecheck": "tsc --noEmit", - "lint": "eslint 'src/**/*.ts'", - "lint:fix": "eslint 'src/**/*.ts' --fix", + "lint": "eslint --config config/eslint.config.js 'src/**/*.ts'", + "lint:fix": "eslint --config config/eslint.config.js 'src/**/*.ts' --fix", "format": "prettier --write 'src/**/*.ts'", "format:check": "prettier --check 'src/**/*.ts'", "capture:subagents": "node scripts/capture-subagent-screenshots.mjs", diff --git a/public b/public deleted file mode 120000 index b9e407f6..00000000 --- a/public +++ /dev/null @@ -1 +0,0 @@ -tools/remotion/public \ No newline at end of file diff --git a/scripts/capture-readme-screenshots.mjs b/scripts/capture-readme-screenshots.mjs index f4b34f49..f2bb5ffb 100644 --- a/scripts/capture-readme-screenshots.mjs +++ b/scripts/capture-readme-screenshots.mjs @@ -428,7 +428,7 @@ const SUBAGENT_ACTIVITY = { 'agent-002': [ { type: 'tool', tool: 'Glob', input: { pattern: 'test/**/*.test.ts' }, timestamp: new Date().toISOString(), agentId: 'agent-002' }, { type: 'tool', tool: 'Read', input: { file_path: '/home/arkon/codeman/test/respawn-test-utils.ts' }, timestamp: new Date().toISOString(), agentId: 'agent-002' }, - { type: 'tool', tool: 'Read', input: { file_path: '/home/arkon/codeman/vitest.config.ts' }, timestamp: new Date().toISOString(), agentId: 'agent-002' }, + { type: 'tool', tool: 'Read', input: { file_path: '/home/arkon/codeman/config/vitest.config.ts' }, timestamp: new Date().toISOString(), agentId: 'agent-002' }, { type: 'message', role: 'assistant', text: 'Analyzing test patterns: MockSession, unique ports, fileParallelism: false...', timestamp: new Date().toISOString(), agentId: 'agent-002' }, ], }; diff --git a/scripts/capture-video-screenshots.mjs b/scripts/capture-video-screenshots.mjs index 037d27b9..172e332c 100644 --- a/scripts/capture-video-screenshots.mjs +++ b/scripts/capture-video-screenshots.mjs @@ -9,7 +9,7 @@ * * Usage: node scripts/capture-video-screenshots.mjs * Port: 3198 (static file server) - * Output: remotion/public/ (6 PNGs) + * Output: scripts/scripts/remotion/public/ (6 PNGs) */ import { chromium } from 'playwright'; @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url'; const __dirname = fileURLToPath(new URL('.', import.meta.url)); const PROJECT_ROOT = join(__dirname, '..'); const PUBLIC_DIR = join(PROJECT_ROOT, 'src', 'web', 'public'); -const OUTPUT_DIR = join(PROJECT_ROOT, 'remotion', 'public'); +const OUTPUT_DIR = join(PROJECT_ROOT, 'scripts', 'remotion', 'public'); const PORT = 3198; const DESKTOP_VIEWPORT = { width: 1920, height: 1080 }; @@ -516,7 +516,7 @@ async function captureDesktopWelcome(browser) { path: join(OUTPUT_DIR, 'desktop-welcome.png'), fullPage: false, }); - console.log(' Saved: remotion/public/desktop-welcome.png'); + console.log(' Saved: scripts/remotion/public/desktop-welcome.png'); } finally { await context.close(); } @@ -545,7 +545,7 @@ async function captureDesktopClaude(browser) { path: join(OUTPUT_DIR, 'desktop-claude.png'), fullPage: false, }); - console.log(' Saved: remotion/public/desktop-claude.png'); + console.log(' Saved: scripts/remotion/public/desktop-claude.png'); } finally { await context.close(); } @@ -575,7 +575,7 @@ async function captureDesktopBothClaude(browser) { path: join(OUTPUT_DIR, 'desktop-both-claude.png'), fullPage: false, }); - console.log(' Saved: remotion/public/desktop-both-claude.png'); + console.log(' Saved: scripts/remotion/public/desktop-both-claude.png'); } finally { await context.close(); } @@ -605,7 +605,7 @@ async function captureDesktopBothOpencode(browser) { path: join(OUTPUT_DIR, 'desktop-both-opencode.png'), fullPage: false, }); - console.log(' Saved: remotion/public/desktop-both-opencode.png'); + console.log(' Saved: scripts/remotion/public/desktop-both-opencode.png'); } finally { await context.close(); } @@ -634,7 +634,7 @@ async function captureMobileClaude(browser) { path: join(OUTPUT_DIR, 'mobile-claude.png'), fullPage: false, }); - console.log(' Saved: remotion/public/mobile-claude.png'); + console.log(' Saved: scripts/remotion/public/mobile-claude.png'); } finally { await context.close(); } @@ -663,7 +663,7 @@ async function captureMobileOpencode(browser) { path: join(OUTPUT_DIR, 'mobile-opencode.png'), fullPage: false, }); - console.log(' Saved: remotion/public/mobile-opencode.png'); + console.log(' Saved: scripts/remotion/public/mobile-opencode.png'); } finally { await context.close(); } @@ -706,12 +706,12 @@ async function main() { console.log('All 6 screenshots captured!'); console.log('='.repeat(60)); console.log('\nOutput files:'); - console.log(' remotion/public/desktop-welcome.png'); - console.log(' remotion/public/desktop-claude.png'); - console.log(' remotion/public/desktop-both-claude.png'); - console.log(' remotion/public/desktop-both-opencode.png'); - console.log(' remotion/public/mobile-claude.png'); - console.log(' remotion/public/mobile-opencode.png'); + console.log(' scripts/remotion/public/desktop-welcome.png'); + console.log(' scripts/remotion/public/desktop-claude.png'); + console.log(' scripts/remotion/public/desktop-both-claude.png'); + console.log(' scripts/remotion/public/desktop-both-opencode.png'); + console.log(' scripts/remotion/public/mobile-claude.png'); + console.log(' scripts/remotion/public/mobile-opencode.png'); } catch (err) { console.error('\nFatal error:', err.message); console.error(err.stack); diff --git a/tools/remotion/Root.tsx b/scripts/remotion/Root.tsx similarity index 100% rename from tools/remotion/Root.tsx rename to scripts/remotion/Root.tsx diff --git a/tools/remotion/components/ClickCursor.tsx b/scripts/remotion/components/ClickCursor.tsx similarity index 100% rename from tools/remotion/components/ClickCursor.tsx rename to scripts/remotion/components/ClickCursor.tsx diff --git a/tools/remotion/components/IOSKeyboard.tsx b/scripts/remotion/components/IOSKeyboard.tsx similarity index 100% rename from tools/remotion/components/IOSKeyboard.tsx rename to scripts/remotion/components/IOSKeyboard.tsx diff --git a/tools/remotion/components/IPhone17ProFrame.tsx b/scripts/remotion/components/IPhone17ProFrame.tsx similarity index 100% rename from tools/remotion/components/IPhone17ProFrame.tsx rename to scripts/remotion/components/IPhone17ProFrame.tsx diff --git a/tools/remotion/components/PhoneFrame.tsx b/scripts/remotion/components/PhoneFrame.tsx similarity index 100% rename from tools/remotion/components/PhoneFrame.tsx rename to scripts/remotion/components/PhoneFrame.tsx diff --git a/tools/remotion/components/TerminalScreen.tsx b/scripts/remotion/components/TerminalScreen.tsx similarity index 100% rename from tools/remotion/components/TerminalScreen.tsx rename to scripts/remotion/components/TerminalScreen.tsx diff --git a/tools/remotion/components/TitleCard.tsx b/scripts/remotion/components/TitleCard.tsx similarity index 100% rename from tools/remotion/components/TitleCard.tsx rename to scripts/remotion/components/TitleCard.tsx diff --git a/tools/remotion/compositions/CodemanDemo.tsx b/scripts/remotion/compositions/CodemanDemo.tsx similarity index 100% rename from tools/remotion/compositions/CodemanDemo.tsx rename to scripts/remotion/compositions/CodemanDemo.tsx diff --git a/tools/remotion/compositions/ZerolagDemo.tsx b/scripts/remotion/compositions/ZerolagDemo.tsx similarity index 100% rename from tools/remotion/compositions/ZerolagDemo.tsx rename to scripts/remotion/compositions/ZerolagDemo.tsx diff --git a/tools/remotion/index.ts b/scripts/remotion/index.ts similarity index 100% rename from tools/remotion/index.ts rename to scripts/remotion/index.ts diff --git a/tools/remotion/lib/theme.ts b/scripts/remotion/lib/theme.ts similarity index 100% rename from tools/remotion/lib/theme.ts rename to scripts/remotion/lib/theme.ts diff --git a/tools/remotion/public/desktop-both-claude.png b/scripts/remotion/public/desktop-both-claude.png similarity index 100% rename from tools/remotion/public/desktop-both-claude.png rename to scripts/remotion/public/desktop-both-claude.png diff --git a/tools/remotion/public/desktop-both-opencode.png b/scripts/remotion/public/desktop-both-opencode.png similarity index 100% rename from tools/remotion/public/desktop-both-opencode.png rename to scripts/remotion/public/desktop-both-opencode.png diff --git a/tools/remotion/public/desktop-claude.png b/scripts/remotion/public/desktop-claude.png similarity index 100% rename from tools/remotion/public/desktop-claude.png rename to scripts/remotion/public/desktop-claude.png diff --git a/tools/remotion/public/desktop-welcome.png b/scripts/remotion/public/desktop-welcome.png similarity index 100% rename from tools/remotion/public/desktop-welcome.png rename to scripts/remotion/public/desktop-welcome.png diff --git a/tools/remotion/public/mobile-claude.png b/scripts/remotion/public/mobile-claude.png similarity index 100% rename from tools/remotion/public/mobile-claude.png rename to scripts/remotion/public/mobile-claude.png diff --git a/tools/remotion/public/mobile-opencode.png b/scripts/remotion/public/mobile-opencode.png similarity index 100% rename from tools/remotion/public/mobile-opencode.png rename to scripts/remotion/public/mobile-opencode.png diff --git a/test-results/.last-run.json b/test-results/.last-run.json deleted file mode 100644 index 5fca3f84..00000000 --- a/test-results/.last-run.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "status": "failed", - "failedTests": [] -} \ No newline at end of file diff --git a/mobile-test/README.md b/test/mobile/README.md similarity index 96% rename from mobile-test/README.md rename to test/mobile/README.md index ce98c344..36044a15 100644 --- a/mobile-test/README.md +++ b/test/mobile/README.md @@ -18,20 +18,20 @@ Validates Codeman's mobile UI across 135 devices, covering: ```bash # Run all mobile tests -npx vitest run --config mobile-test/vitest.config.ts +npx vitest run --config test/mobile/vitest.config.ts # Run a single test file -npx vitest run --config mobile-test/vitest.config.ts mobile-test/keyboard.test.ts +npx vitest run --config test/mobile/vitest.config.ts test/mobile/keyboard.test.ts # Quick mode — 6 representative devices, skip full matrix -CI_QUICK=1 npx vitest run --config mobile-test/vitest.config.ts +CI_QUICK=1 npx vitest run --config test/mobile/vitest.config.ts # Full device matrix only (135 devices) -npx vitest run --config mobile-test/vitest.config.ts mobile-test/device-matrix.test.ts +npx vitest run --config test/mobile/vitest.config.ts test/mobile/device-matrix.test.ts # Update visual baselines (delete old baselines, re-run) -rm -rf mobile-test/snapshots/*.png -npx vitest run --config mobile-test/vitest.config.ts mobile-test/visual-regression.test.ts +rm -rf test/mobile/snapshots/*.png +npx vitest run --config test/mobile/vitest.config.ts test/mobile/visual-regression.test.ts ``` ## Test Files @@ -126,7 +126,7 @@ Swipe simulation includes intermediate move points and timing to satisfy `SwipeH Uses `pixelmatch` + `pngjs` (both in devDeps) for pixel-level comparison: -- **Baselines** stored in `mobile-test/snapshots/` (git-tracked) +- **Baselines** stored in `test/mobile/snapshots/` (git-tracked) - **Tolerance**: 0.5% pixel diff (handles anti-aliasing) - **On failure**: `.actual.png` and `.diff.png` generated (gitignored) - **Update**: Delete baseline PNGs and re-run — new baselines auto-created diff --git a/mobile-test/accessibility.test.ts b/test/mobile/accessibility.test.ts similarity index 100% rename from mobile-test/accessibility.test.ts rename to test/mobile/accessibility.test.ts diff --git a/mobile-test/device-matrix.test.ts b/test/mobile/device-matrix.test.ts similarity index 100% rename from mobile-test/device-matrix.test.ts rename to test/mobile/device-matrix.test.ts diff --git a/mobile-test/devices.ts b/test/mobile/devices.ts similarity index 100% rename from mobile-test/devices.ts rename to test/mobile/devices.ts diff --git a/mobile-test/helpers/assertions.ts b/test/mobile/helpers/assertions.ts similarity index 100% rename from mobile-test/helpers/assertions.ts rename to test/mobile/helpers/assertions.ts diff --git a/mobile-test/helpers/browser.ts b/test/mobile/helpers/browser.ts similarity index 100% rename from mobile-test/helpers/browser.ts rename to test/mobile/helpers/browser.ts diff --git a/mobile-test/helpers/cdp.ts b/test/mobile/helpers/cdp.ts similarity index 100% rename from mobile-test/helpers/cdp.ts rename to test/mobile/helpers/cdp.ts diff --git a/mobile-test/helpers/constants.ts b/test/mobile/helpers/constants.ts similarity index 98% rename from mobile-test/helpers/constants.ts rename to test/mobile/helpers/constants.ts index 3ce0b112..5628bd49 100644 --- a/mobile-test/helpers/constants.ts +++ b/test/mobile/helpers/constants.ts @@ -96,7 +96,7 @@ export const SUBAGENT = { export const VISUAL = { DEFAULT_THRESHOLD: 0.1, MAX_DIFF_PERCENT: 0.5, - SNAPSHOT_DIR: 'mobile-test/snapshots', + SNAPSHOT_DIR: 'test/mobile/snapshots', } as const; // Visual regression breakpoints (width values for screenshot comparison) diff --git a/mobile-test/helpers/keyboard-sim.ts b/test/mobile/helpers/keyboard-sim.ts similarity index 100% rename from mobile-test/helpers/keyboard-sim.ts rename to test/mobile/helpers/keyboard-sim.ts diff --git a/mobile-test/helpers/server.ts b/test/mobile/helpers/server.ts similarity index 100% rename from mobile-test/helpers/server.ts rename to test/mobile/helpers/server.ts diff --git a/mobile-test/helpers/touch-sim.ts b/test/mobile/helpers/touch-sim.ts similarity index 100% rename from mobile-test/helpers/touch-sim.ts rename to test/mobile/helpers/touch-sim.ts diff --git a/mobile-test/helpers/visual.ts b/test/mobile/helpers/visual.ts similarity index 100% rename from mobile-test/helpers/visual.ts rename to test/mobile/helpers/visual.ts diff --git a/mobile-test/keyboard.test.ts b/test/mobile/keyboard.test.ts similarity index 100% rename from mobile-test/keyboard.test.ts rename to test/mobile/keyboard.test.ts diff --git a/mobile-test/layout.test.ts b/test/mobile/layout.test.ts similarity index 100% rename from mobile-test/layout.test.ts rename to test/mobile/layout.test.ts diff --git a/mobile-test/settings.test.ts b/test/mobile/settings.test.ts similarity index 100% rename from mobile-test/settings.test.ts rename to test/mobile/settings.test.ts diff --git a/mobile-test/snapshots/.gitkeep b/test/mobile/snapshots/.gitkeep similarity index 100% rename from mobile-test/snapshots/.gitkeep rename to test/mobile/snapshots/.gitkeep diff --git a/mobile-test/snapshots/device-ipad-mini.png b/test/mobile/snapshots/device-ipad-mini.png similarity index 100% rename from mobile-test/snapshots/device-ipad-mini.png rename to test/mobile/snapshots/device-ipad-mini.png diff --git a/mobile-test/snapshots/device-ipad-pro-11.png b/test/mobile/snapshots/device-ipad-pro-11.png similarity index 100% rename from mobile-test/snapshots/device-ipad-pro-11.png rename to test/mobile/snapshots/device-ipad-pro-11.png diff --git a/mobile-test/snapshots/device-iphone-14-pro.png b/test/mobile/snapshots/device-iphone-14-pro.png similarity index 100% rename from mobile-test/snapshots/device-iphone-14-pro.png rename to test/mobile/snapshots/device-iphone-14-pro.png diff --git a/mobile-test/snapshots/device-iphone-15-pro-max.png b/test/mobile/snapshots/device-iphone-15-pro-max.png similarity index 100% rename from mobile-test/snapshots/device-iphone-15-pro-max.png rename to test/mobile/snapshots/device-iphone-15-pro-max.png diff --git a/mobile-test/snapshots/device-iphone-se.png b/test/mobile/snapshots/device-iphone-se.png similarity index 100% rename from mobile-test/snapshots/device-iphone-se.png rename to test/mobile/snapshots/device-iphone-se.png diff --git a/mobile-test/snapshots/device-nexus-7.png b/test/mobile/snapshots/device-nexus-7.png similarity index 100% rename from mobile-test/snapshots/device-nexus-7.png rename to test/mobile/snapshots/device-nexus-7.png diff --git a/mobile-test/snapshots/keyboard-1024w.png b/test/mobile/snapshots/keyboard-1024w.png similarity index 100% rename from mobile-test/snapshots/keyboard-1024w.png rename to test/mobile/snapshots/keyboard-1024w.png diff --git a/mobile-test/snapshots/keyboard-320w.png b/test/mobile/snapshots/keyboard-320w.png similarity index 100% rename from mobile-test/snapshots/keyboard-320w.png rename to test/mobile/snapshots/keyboard-320w.png diff --git a/mobile-test/snapshots/keyboard-375w.png b/test/mobile/snapshots/keyboard-375w.png similarity index 100% rename from mobile-test/snapshots/keyboard-375w.png rename to test/mobile/snapshots/keyboard-375w.png diff --git a/mobile-test/snapshots/keyboard-393w.png b/test/mobile/snapshots/keyboard-393w.png similarity index 100% rename from mobile-test/snapshots/keyboard-393w.png rename to test/mobile/snapshots/keyboard-393w.png diff --git a/mobile-test/snapshots/keyboard-430w.png b/test/mobile/snapshots/keyboard-430w.png similarity index 100% rename from mobile-test/snapshots/keyboard-430w.png rename to test/mobile/snapshots/keyboard-430w.png diff --git a/mobile-test/snapshots/keyboard-768w.png b/test/mobile/snapshots/keyboard-768w.png similarity index 100% rename from mobile-test/snapshots/keyboard-768w.png rename to test/mobile/snapshots/keyboard-768w.png diff --git a/mobile-test/snapshots/landing-1024w.png b/test/mobile/snapshots/landing-1024w.png similarity index 100% rename from mobile-test/snapshots/landing-1024w.png rename to test/mobile/snapshots/landing-1024w.png diff --git a/mobile-test/snapshots/landing-320w.png b/test/mobile/snapshots/landing-320w.png similarity index 100% rename from mobile-test/snapshots/landing-320w.png rename to test/mobile/snapshots/landing-320w.png diff --git a/mobile-test/snapshots/landing-375w.png b/test/mobile/snapshots/landing-375w.png similarity index 100% rename from mobile-test/snapshots/landing-375w.png rename to test/mobile/snapshots/landing-375w.png diff --git a/mobile-test/snapshots/landing-393w.png b/test/mobile/snapshots/landing-393w.png similarity index 100% rename from mobile-test/snapshots/landing-393w.png rename to test/mobile/snapshots/landing-393w.png diff --git a/mobile-test/snapshots/landing-430w.png b/test/mobile/snapshots/landing-430w.png similarity index 100% rename from mobile-test/snapshots/landing-430w.png rename to test/mobile/snapshots/landing-430w.png diff --git a/mobile-test/snapshots/landing-768w.png b/test/mobile/snapshots/landing-768w.png similarity index 100% rename from mobile-test/snapshots/landing-768w.png rename to test/mobile/snapshots/landing-768w.png diff --git a/mobile-test/snapshots/settings-1024w.png b/test/mobile/snapshots/settings-1024w.png similarity index 100% rename from mobile-test/snapshots/settings-1024w.png rename to test/mobile/snapshots/settings-1024w.png diff --git a/mobile-test/snapshots/settings-320w.png b/test/mobile/snapshots/settings-320w.png similarity index 100% rename from mobile-test/snapshots/settings-320w.png rename to test/mobile/snapshots/settings-320w.png diff --git a/mobile-test/snapshots/settings-375w.png b/test/mobile/snapshots/settings-375w.png similarity index 100% rename from mobile-test/snapshots/settings-375w.png rename to test/mobile/snapshots/settings-375w.png diff --git a/mobile-test/snapshots/settings-393w.png b/test/mobile/snapshots/settings-393w.png similarity index 100% rename from mobile-test/snapshots/settings-393w.png rename to test/mobile/snapshots/settings-393w.png diff --git a/mobile-test/snapshots/settings-430w.png b/test/mobile/snapshots/settings-430w.png similarity index 100% rename from mobile-test/snapshots/settings-430w.png rename to test/mobile/snapshots/settings-430w.png diff --git a/mobile-test/snapshots/settings-768w.png b/test/mobile/snapshots/settings-768w.png similarity index 100% rename from mobile-test/snapshots/settings-768w.png rename to test/mobile/snapshots/settings-768w.png diff --git a/mobile-test/subagent-windows.test.ts b/test/mobile/subagent-windows.test.ts similarity index 100% rename from mobile-test/subagent-windows.test.ts rename to test/mobile/subagent-windows.test.ts diff --git a/mobile-test/tabs.test.ts b/test/mobile/tabs.test.ts similarity index 100% rename from mobile-test/tabs.test.ts rename to test/mobile/tabs.test.ts diff --git a/mobile-test/visual-regression.test.ts b/test/mobile/visual-regression.test.ts similarity index 96% rename from mobile-test/visual-regression.test.ts rename to test/mobile/visual-regression.test.ts index 2f462216..19f50a38 100644 --- a/mobile-test/visual-regression.test.ts +++ b/test/mobile/visual-regression.test.ts @@ -166,19 +166,19 @@ describe('Visual Regression', () => { * To update visual baselines: * * 1. Delete the specific snapshot: - * rm mobile-test/snapshots/.png + * rm test/mobile/snapshots/.png * * 2. Re-run the test: - * npx vitest run mobile-test/visual-regression.test.ts + * npx vitest run test/mobile/visual-regression.test.ts * * 3. Review the new baseline: * The test will create a fresh .png and pass (isNewBaseline = true). * * To update ALL baselines: - * rm -rf mobile-test/snapshots/ && npx vitest run mobile-test/visual-regression.test.ts + * rm -rf test/mobile/snapshots/ && npx vitest run test/mobile/visual-regression.test.ts * * Diff images for failed comparisons are saved as .diff.png - * alongside the baseline in mobile-test/snapshots/. + * alongside the baseline in test/mobile/snapshots/. */ it('placeholder — see comments above for baseline update instructions', () => { expect(true).toBe(true); diff --git a/mobile-test/vitest.config.ts b/test/mobile/vitest.config.ts similarity index 64% rename from mobile-test/vitest.config.ts rename to test/mobile/vitest.config.ts index d301bb5f..169bd633 100644 --- a/mobile-test/vitest.config.ts +++ b/test/mobile/vitest.config.ts @@ -1,10 +1,14 @@ +import { resolve } from 'node:path'; import { defineConfig } from 'vitest/config'; +const root = resolve(import.meta.dirname, '../..'); + export default defineConfig({ test: { + root, globals: true, environment: 'node', - include: ['mobile-test/**/*.test.ts'], + include: ['test/mobile/**/*.test.ts'], setupFiles: ['./test/setup.ts'], fileParallelism: false, testTimeout: 60_000, diff --git a/tmp/desktop-toolbar.png b/tmp/desktop-toolbar.png deleted file mode 100644 index d26ec2e4..00000000 Binary files a/tmp/desktop-toolbar.png and /dev/null differ diff --git a/tmp/ipad-mini-keyboard.png b/tmp/ipad-mini-keyboard.png deleted file mode 100644 index 8a689b1f..00000000 Binary files a/tmp/ipad-mini-keyboard.png and /dev/null differ diff --git a/tmp/ipad-mini-normal.png b/tmp/ipad-mini-normal.png deleted file mode 100644 index b39aa05e..00000000 Binary files a/tmp/ipad-mini-normal.png and /dev/null differ diff --git a/tmp/ipad-mini-pr34-keyboard.png b/tmp/ipad-mini-pr34-keyboard.png deleted file mode 100644 index 41d45a9c..00000000 Binary files a/tmp/ipad-mini-pr34-keyboard.png and /dev/null differ diff --git a/tmp/ipad-mini-pr34-normal.png b/tmp/ipad-mini-pr34-normal.png deleted file mode 100644 index a34ca42e..00000000 Binary files a/tmp/ipad-mini-pr34-normal.png and /dev/null differ diff --git a/tmp/ipad-mini-pr34-tabbar.png b/tmp/ipad-mini-pr34-tabbar.png deleted file mode 100644 index 1e4147e6..00000000 Binary files a/tmp/ipad-mini-pr34-tabbar.png and /dev/null differ diff --git a/tmp/ipad-mini-tabbar.png b/tmp/ipad-mini-tabbar.png deleted file mode 100644 index 3db06d24..00000000 Binary files a/tmp/ipad-mini-tabbar.png and /dev/null differ diff --git a/tmp/ipad-mini-toolbar.png b/tmp/ipad-mini-toolbar.png deleted file mode 100644 index 096271ef..00000000 Binary files a/tmp/ipad-mini-toolbar.png and /dev/null differ