Skip to content

Fixtures & poll

Each fixture is the smallest markup that produces one failure a rule claims to catch, paired with the corrected version. A rule that passes its own failure is decoration. Shapes, not screenshots — ids and copy are deliberately boring.

Import from htmx-contract/fixtures. Exercised in regressions.test.ts, contract.test.ts, and poll.test.ts.

ConstantRule / purpose
TOAST_ONLY_422empty-after-oob bug
TOAST_ONLY_422_FIXED_HEADERSFix: { "HX-Reswap": "none" }
TABLE_WRAPPED_IN_FORMduplicate-field-in-form (+ duplicate-id)
TABLE_WITH_HX_INCLUDEPer-row hx-* without an enclosing form
LIST_WITH_ONE_ROW + DELETE_ROW_ONLYtarget-identity-lost
DELETE_WHOLE_LISTCorrect last-row delete
UNBOUNDED_POLL / BOUNDED_POLLunbounded-poll
PAGEMinimal document to swap into

From htmx-contract/poll:

  • pollAttributes({ url, target, attempt, maxAttempts, … }) — attribute string for the next attempt, or null when exhausted.
  • readAttempt(value) — parse the attempt query param; non-integers become 0.

The bound attribute is data-poll-max (BOUNDED_POLL_ATTR). Generated apps wrap this in src/lib/polling.ts (poll / pollExhausted) — see Bounded poll.