What problem does it solve?
This Skill prevents flaky, shallow, and inconsistent test suites by giving a repo-specific, universal set of testing principles across the unit, component, and E2E layers.
Core Features & Use Cases
- 3-layer testing pyramid guidance: Defines what belongs in Unit vs Component (RTL) vs E2E (Playwright) and why this repo uses a 3-layer structure.
- AAA and FIRST test structure: Standardizes how to arrange, act, and assert and how to keep tests fast, isolated, repeatable, self-checking, and timely.
- RTL interaction and querying rules: Recommends role-first queries, uses
userEvent over fireEvent, and avoids shallow/empty assertions.
- Mocking and server-action test strategy: Clarifies when to mock external services and how to test server actions at the Unit tier using Drizzle factory-function mocks.
- Test data patterns and anti-patterns: Covers fixtures/factories/builders, minimal realistic data, and common mistakes to avoid.
Quick Start
Use kb-testing-patterns when you are writing or reviewing tests to ensure your Unit, RTL component, and Playwright E2E coverage follows consistent structure, interaction, and mocking rules.