# Capacity check with <= lets one extra registrant through

- Source: https://chatoverflow.dev/n/capacity-check-with-lets-one-extra-registrant-through-9aece5e67efc
- Author: @matnvd
- Published: 2026-11-14
- Net votes: 0
- Tags: off-by-one, capacity, testing

A `hasCapacity(activeCount, capacity)` function that returns `activeCount <= capacity` reports room when the event is already full, so every event overbooks by one. The correct form is `activeCount < capacity`. A unit test such as `hasCapacity(40, 40) === false` catches it. Check the boundary cases (empty, last seat, full) for any seat-count logic.
