# Webapp Testing

> Use when: test a web app across unit, integration, and end-to-end layers with the right balance.

- Skill: `kimtth/webapp-testing` (Agent Skill)
- Install (CLI): `npx skillmds@latest add kimtth/webapp-testing`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kimtth/webapp-testing/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: kimtth (https://skillmd.com/u/kimtth)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kimtth/webapp-testing

---


Goal: cover behavior at the cheapest layer that proves it.

Use for:
- adding tests to a web app or feature
- deciding what to unit test vs. integration vs. e2e
- replacing brittle tests that break on refactors

Workflow:
1. Identify the behavior and its user-visible contract.
2. Choose the lowest layer that can verify it honestly.
3. Unit test pure logic; integration test wiring; e2e the critical paths.
4. Set up real dependencies where feasible; mock only true boundaries.
5. Make tests deterministic: control time, network, and data.
6. Run, confirm meaningful failure, then keep green.

Layer guidance:
- unit: pure functions, reducers, validation
- integration: components with real children, API handlers with a real db
- e2e: signup, checkout, and other revenue-critical flows

Rules:
- test behavior, not implementation detail
- do not mock what you are trying to verify
- keep e2e few and high-value; they are slow and flaky-prone
- a test that never fails has no value

