Skip to content

test(src/lib): 2c - add tests for untested modules - #136

Draft
sukhada wants to merge 1 commit into
claude/lib-cleanup-2bfrom
claude/lib-cleanup-2c
Draft

test(src/lib): 2c - add tests for untested modules#136
sukhada wants to merge 1 commit into
claude/lib-cleanup-2bfrom
claude/lib-cleanup-2c

Conversation

@sukhada

@sukhada sukhada commented Mar 21, 2026

Copy link
Copy Markdown

Summary

Phase 2C of the src/lib/ modernization. Adds test coverage for previously untested modules and expands thin existing test files. Purely additive — documents current behavior as a safety net before refactoring in later PRs.

New test files (4):

  • phone-format.spec.tsgetFormattedPhoneNumber, phoneNumberRegex
  • permissions.spec.ts — all role functions, documents getHighestRole input mutation bug
  • attributes.spec.tscamelCase, titleCase, snakeToTitleCase, nameComponents, recordToCamelCase
  • datetime.spec.tsparseIanaZone, deprecatedTimezoneMap, DateTime.setZone

Expanded existing files (3):

  • tz-helpers.spec.ts — added isValidTimezone and asUtc
  • interaction-step-helpers.spec.ts — added interactionStepForId (documents last-match behavior) and getTopMostParent
  • utils.spec.ts — added edge cases for URL validation, replaceAll, percentages

Stacked on: #135

Test plan

  • 105 tests pass, 2 skipped (known zip-format bugs)
  • Lint and prettier clean
  • CI passes

Generated with Claude Code

@sukhada
sukhada force-pushed the claude/lib-cleanup-2b branch from a3e884c to 3c39955 Compare March 21, 2026 23:55
@sukhada
sukhada force-pushed the claude/lib-cleanup-2c branch from 2b8d176 to 149efc2 Compare March 21, 2026 23:55
@sukhada sukhada changed the title test: add tests for untested lib modules and expand existing coverage test(2c): add tests for untested lib modules and expand existing coverage Mar 21, 2026
@sukhada sukhada changed the title test(2c): add tests for untested lib modules and expand existing coverage test(src/lib): 2c - add tests for untested modules Mar 21, 2026
New test files for previously untested modules:
- phone-format.spec.ts: getFormattedPhoneNumber, phoneNumberRegex
- permissions.spec.ts: all exported role functions, documents
  getHighestRole input mutation bug
- attributes.spec.ts: camelCase, titleCase, snakeToTitleCase,
  nameComponents, recordToCamelCase
- datetime.spec.ts: parseIanaZone, deprecatedTimezoneMap, DateTime.setZone

Expanded existing test files:
- tz-helpers.spec.ts: added isValidTimezone and asUtc tests
- interaction-step-helpers.spec.ts: added interactionStepForId
  (documents last-match behavior) and getTopMostParent tests
- utils.spec.ts: added edge cases for stringIsAValidUrl, replaceAll,
  asPercent, asPercentWithTotal

Total: 105 tests passing, 2 skipped (known zip-format bugs).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant