Skip to content

test(oauth-provider): unit coverage for base64url helpers - #1819

Merged
sempostma merged 1 commit into
mainfrom
test/dcms-1818-base64url-test-coverage
Aug 5, 2026
Merged

sempostma merged 1 commit into
mainfrom
test/dcms-1818-base64url-test-coverage

Conversation

@sempostma

Copy link
Copy Markdown
Member

Closes #1818

Adds packages/decap-cms-oauth-provider/src/__tests__/base64url.spec.ts covering the previously-untested base64url helpers:

  • bytesToBase64Url / base64UrlToBytes round-trip for empty, single-byte, and multi-byte inputs
  • url-safe substitution: output never contains +, /, or =; explicit check that a byte sequence which produces both + and / in standard base64 is correctly mapped to -/_
  • textToBase64Url / base64UrlToText round-trip for ASCII and multi-byte UTF-8 (including emoji and accented characters)
  • base64UrlToBytes padding reconstruction for input lengths of length % 4 = 0, 2, 3 (round-trips correctly) and 1 (asserted to throw, since no valid base64(url) string has length % 4 === 1)

No changes to base64url.ts — test-only PR, matches the existing __tests__/*.spec.ts style used by sibling modules in the package (state.spec.ts, html.spec.ts, etc.).

Gate: type-check, lint, and test:unit all pass locally (full monorepo run), including via the repo's pre-push husky hook.

@sempostma
sempostma merged commit d1dc688 into main Aug 5, 2026
2 checks passed
@sempostma
sempostma deleted the test/dcms-1818-base64url-test-coverage branch August 5, 2026 02:37
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.

test(oauth-provider): unit coverage for base64url helpers — DCMS-1818

1 participant