Skip to content

test: update utilities.test.ts for Better Auth#138

Merged
JacksonMeade merged 2 commits intomainfrom
fix/utilities-test
Mar 17, 2026
Merged

test: update utilities.test.ts for Better Auth#138
JacksonMeade merged 2 commits intomainfrom
fix/utilities-test

Conversation

@jakebromberg
Copy link
Copy Markdown
Member

@jakebromberg jakebromberg commented Feb 3, 2026

Closes #239

Summary

Replace obsolete Cognito-specific tests with Better Auth tests:

  • Remove toUser and toClient tests (Cognito functions no longer exist)
  • Add toUserFromBetterAuthJWT tests
  • Add betterAuthSessionToAuthenticationData tests
  • Test IncompleteUser detection for missing realName/djName

Test plan

  • All 22 tests pass

Note: E2E tests depend on #271 and WXYC/Backend-Service#223. E2E will pass once those merge.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Feb 3, 2026

Deploying wxyc-dj with  Cloudflare Pages  Cloudflare Pages

Latest commit: 26cf1aa
Status: ✅  Deploy successful!
Preview URL: https://66df6b30.dj-site.pages.dev
Branch Preview URL: https://fix-utilities-test.dj-site.pages.dev

View logs

@jakebromberg jakebromberg marked this pull request as ready for review February 26, 2026 15:43
@jakebromberg jakebromberg force-pushed the fix/utilities-test branch 2 times, most recently from b1c2a9f to 65ae248 Compare March 2, 2026 15:36
Jake Bromberg and others added 2 commits March 8, 2026 18:34
Replace obsolete Cognito-specific tests with Better Auth tests:
- Remove toUser and toClient tests (Cognito functions no longer exist)
- Add toUserFromBetterAuthJWT tests
- Add betterAuthSessionToAuthenticationData tests
- Test IncompleteUser detection for missing realName/djName

Co-authored-by: Cursor <cursoragent@cursor.com>
…a test

The test accessed .message directly on defaultAuthenticationData which is typed as the AuthenticationData union. TypeScript rejects this because .message only exists on one variant. Use an in check and type assertion to safely access the property.
@JacksonMeade JacksonMeade merged commit cf1bf9c into main Mar 17, 2026
5 checks passed
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.

utilities.test.ts references obsolete Cognito auth functions

2 participants