gstack/design/test
Jayesh Betala 68f646d1e5 fix(design/variants): guard --count against NaN/zero/negative input
`design variants --count <bad value>` silently produced zero variants
because the generation loop only clamped the upper bound. `--count` arrives
via `parseInt`, which yields NaN for non-numeric input ("abc") and passes
zero/negative values straight through. `Math.min(NaN, 7)` is NaN, so the
`for (i = 0; i < NaN; i++)` loop never ran and the JSON result emitted
`"count": null` — a confusing success-with-nothing for any caller parsing it.

Add an exported `normalizeVariantCount` helper that clamps to the supported
[1, 7] range and falls back to the default of 3 for non-finite input, then
use it where the bare upper-bound cap was. Pure and unit-tested so the
behavior is pinned without an API key.

Fixes #2032

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 12:32:19 +05:30
..
auth.test.ts v1.42.0.0 Daegu wave: 23 community-filed bugs + PTY classifier enforcement (24 bisect commits) (#1594) 2026-05-20 07:35:01 -07:00
daemon-discovery.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
daemon-tests-fixtures.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
daemon.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
feedback-roundtrip-daemon.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
feedback-roundtrip.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
gallery.test.ts feat: design binary — real UI mockup generation for gstack skills (v0.13.0.0) (#551) 2026-03-27 20:32:59 -06:00
serve.test.ts v1.45.0.0 feat(design): persistent board daemon — 24h boards, one tab, board history (#1710) 2026-05-25 20:45:12 -07:00
variants-retry-after.test.ts fix(design/variants): guard --count against NaN/zero/negative input 2026-06-17 12:32:19 +05:30