Skip to content

test: expand keeperapi utils test coverage (2 → 46 tests)#217

Open
ZyAzOsK wants to merge 1 commit into
Keeper-Security:mainfrom
ZyAzOsK:expand-utils-test-coverage
Open

test: expand keeperapi utils test coverage (2 → 46 tests)#217
ZyAzOsK wants to merge 1 commit into
Keeper-Security:mainfrom
ZyAzOsK:expand-utils-test-coverage

Conversation

@ZyAzOsK

@ZyAzOsK ZyAzOsK commented Jul 22, 2026

Copy link
Copy Markdown

Replaces the minimal utils.test.js (2 assertions for webSafe64) with a comprehensive TypeScript test suite covering all pure utility functions in keeperapi/src/utils.ts. No production code changes.

Replace the minimal utils.test.js (2 tests for webSafe64) with a
comprehensive TypeScript test suite covering all pure utility functions
in keeperapi/src/utils.ts:

- webSafe64: plus sign, slash, padding strip, multi-char, empty string
- normal64: dash/underscore reversal, padding restoration, round-trip
- getKeeperUrl: standard paths, bi_api prefix exception, multiple hosts
- getKeeperRouterUrl: default host, govcloud special case
- getKeeperSAMLUrl: with and without serviceProviderId
- getKeeperSsoConfigUrl: with and without serviceProviderId
- getKeeperAutomatorAdminUrl: with and without automatorId
- isTwoFactorResultCode: valid codes and non-matching inputs
- formatTimeDiff: zero, seconds-only, minutes+seconds, padding
- isNil: null, undefined, and falsy-but-not-nil values
- toOptional: null/undefined conversion, passthrough for values

Total: 46 test cases (up from 2).
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