mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
bb28d252d8
49 -> 65 passing tests, 4 -> 5 test files. New file: tests/api-utils-extra.test.ts (16 cases) - LocalizeFormattedNumber (3): zero/NaN/null guard, sub-1000 stays, >=1000 inserts thin-space group separators. - ColorUtils (8): makeColorHex, makeColorNumberHex (with zero-pad), convertFromHex (with/without #), int_to_8BitVals/eight_bitVals_to_int roundtrip, int2rgb pure-RGB output, zero-input edge cases. - FixedSizeStack (4): grow then overwrite oldest (ring-buffer semantics), reset clears state, partial-fill behavior of getMax, empty-stack returns Number.MIN_VALUE. The "partial-fill" case documents a subtle quirk: getMax iterates the whole maxSize window including undefined slots, but `undefined > X` is false in JS so the inserted value wins — the test pins that behavior. Note on `usePetPackageWidget` and `useWordQuizWidget` - They were both considered for a state/actions split this turn but their actions mutate internal state (`onClose` resets 5 useState, `vote` reads pollId/question/answerSent). A clean split would require either passing args to the action or hoisting the state to a shared store first. Deferred as follow-up. Verification - yarn test: 5 files / 65 cases / ~1.9s. - yarn eslint on the new test file: 0 errors / 0 warnings.