Add validation utility tests and truncate parameter validation#406
Merged
nikblanchet merged 2 commits intomainfrom Nov 28, 2025
Merged
Add validation utility tests and truncate parameter validation#406nikblanchet merged 2 commits intomainfrom
nikblanchet merged 2 commits intomainfrom
Conversation
Owner
Author
Code Review: PR #406Approved - Comprehensive validation test coverage successfully addresses post-merge findings from PR #404. See detailed review: Key FindingsStrengths:
Minor improvement opportunity:
Enhancement ideas (low priority):
Test Results
ComplianceAll requirements met:
Good work on the comprehensive test coverage and proper input validation! |
nikblanchet
added a commit
that referenced
this pull request
Nov 28, 2025
- Add truncate validation error tests (negative, non-integer, NaN, Infinity) - Add truncate edge case tests (0 returns empty, large value returns full) - Extract magic numbers to constants (ZERO_UUID_ENCODING, BASE57_EXCLUDED_CHARS) - Add JSDoc example for truncate >= 22 (full formatted output) Addresses code review findings from PR #406 first review. Generated with [Claude Code](https://claude.com/claude-code) Steered and verified by @nikblanchet
- Add comprehensive tests for 5 validation functions: - isValidShortUuid(): valid/invalid shortuuids, hyphenated input - isValidSessionId(): UUID, shortuuid, and hybrid validation - detectSessionIdFormat(): format detection tests - normalizeSessionId(): UUID preservation, hyphen stripping - formatSessionIdForDisplay(): truncation and hyphen formatting - Add truncate parameter validation in formatDisplay(): - Throws if truncate is negative or not an integer - Protects against invalid input values - Add BigInt edge case comment explaining 0n behavior Addresses post-merge review findings from PR #404. Generated with [Claude Code](https://claude.com/claude-code) Steered and verified by @nikblanchet
- Add truncate validation error tests (negative, non-integer, NaN, Infinity) - Add truncate edge case tests (0 returns empty, large value returns full) - Extract magic numbers to constants (ZERO_UUID_ENCODING, BASE57_EXCLUDED_CHARS) - Add JSDoc example for truncate >= 22 (full formatted output) Addresses code review findings from PR #406 first review. Generated with [Claude Code](https://claude.com/claude-code) Steered and verified by @nikblanchet
d37d849 to
705f258
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses findings from post-merge code review of shortuuid implementation (PR #404).
Changes
Tests Added (
cli/src/__tests__/unit/validation.test.ts)isValidShortUuid()isValidSessionId()detectSessionIdFormat()normalizeSessionId()formatSessionIdForDisplay()Code Improvements (
cli/src/utils/shortuuid.ts)Skipped
Optional[int]change: The existingint | Nonesyntax is the modern Python 3.10+ convention (PEP 604) and is correctTest Plan
Generated with Claude Code