## Что это
## Резюме (RU)
G2.2.2.A — Мок WebContentsView для юнит-тестов (Week 0 foundation)
*Полный перевод тела — в работе. Английский оригинал ниже.*
---
# Original (EN)
## Objective
Provide a reusable test-double for WebContentsView so every integration can unit-test without spawning Electron. Currently `RoxDesignViewManager` has \~0% coverage (Lane C audit) because there's no mock. This closes that gap framework-wide.
## Source Links
* Design doc section: `docs/superpowers/specs/2026-05-20-rox-integration-vision-design.md` § 3 (Section 3 → 2.2.A)
* Parent: PZD-77
* Audit context: `docs/audits/2026-05-20-pr268-release-readiness-audit.md`
## Tasks
(a) Create `apps/electron/src/main/integrations/__testing__/mock-web-contents-view.ts` exposing minimal stub: loadURL, setBounds, isDestroyed, on/off, removeAllListeners, executeJavaScript, insertCSS, removeInsertedCSS, send
(b) Stub emits configurable events: did-finish-load, dom-ready, did-start-navigation, will-navigate, render-process-gone
(c) Test helper `mockWebContentsViewFor(manifest)` constructs a fully-stubbed view ready for use in any integration's unit tests
(d) Mock surface mirrors real WebContentsView API closely enough that integration tests using the real one would be straightforward to write later
(e) Demonstrate by writing 3 example tests in `apps/electron/src/main/integrations/__testing__/mock.test.ts`
(f) README in `__testing__/` explaining usage
## Acceptance Criteria
Implementation passes typecheck + lint + targeted unit tests + relevant audit gates. PR backlinks to this Linear issue.
## Implementation Plan
1. Read design doc section 3 (Section 3 → 2.2.A) for full context.
2. Implement tasks above on a feature branch off current main + my 3 PR #268 audit commits (`0d8bf3d2`, `a8f90784`, `4d223078`) or current main if those land first.
3. Atomic commits per task; PR when complete.
4. Update this issue with verification evidence.
## Status / Priority / Estimate
Status: **Todo** (Week 0)
Priority: **High**
Estimate: **S** (\~1-3 dev-days)
Workstream: КОД
## Update Log
* **2026-05-20** Sub-issue created during integration-vision brainstorm. Dispatched to autonomous agent.
## Статус
Это задача из текущего backlog'а ROX.ONE (Linear). Текущий статус в Linear: `К работе — Todo`. Метки: —.
## 🔗 Linear
- [PZD-80](https://linear.app/kuhjie/issue/PZD-80/g222a-mok-webcontentsview-dlya-yunit-testov-week-0-foundation-g222a) — backing ticket
- Parent epic: [PZD-120](https://linear.app/kuhjie/issue/PZD-120)