# REF-TASK-005 — Split the KDS component test by behavior

**Status:** Implemented  
**Kind:** Test-only refactor  
**Depends on:** REF-TASK-004

## Problem and evidence

`frontend/src/pages/KdsPage.test.tsx` is about 1,827 lines. One file verifies sales ticker,
queue/slips, transitions and metadata, cart editing, finalization/payment outcomes, failure states,
layout, and fullscreen behavior. Its broad fetch fixtures make unrelated setup visible to most tests
and will obstruct a mechanical split of `KdsPage.tsx`.

## Proposed change

Split tests into cohesive files adjacent to the KDS feature, for example order-entry/finalization,
kitchen-queue/fulfillment, operational reads/sales, and presentation/fullscreen. Extract only stable
fixtures/builders (catalog products, active orders, default KDS reads) to feature test support.
Retain component-level integration through `KdsPage` for behavior spanning extracted children; later
child-module tests may supplement it but must not replace those contracts.

## Constraints and sequence

Move tests without rewriting assertions first and prove the same test count and scenario-ID set.
Then remove duplicated setup using REF-TASK-004 helpers. Do not change production code, accessible
selectors, scenario titles, or what each test proves. Keep tests for a workflow together even if
splitting by one function would yield more even file sizes.

## Validation

Capture the pre/post Vitest test list or count and traceability report. Run all new KDS test files,
the full frontend suite, `pnpm traceability:check`, and `pnpm quality`. No E2E rerun is required.

## Guidance / ADR

REF-TASK-018 should record test organization by behavior. No ADR.
