Skip to content

test: Fix skipped tests in onboarding and AppleSignInButton #135

@claude

Description

@claude

Summary

There are 3 test suites currently skipped due to mock issues. These tests cover critical authentication and onboarding flows and should be fixed to ensure proper test coverage.

Skipped Tests

1. __tests__/app/onboarding.test.tsx:639

// TODO: Fix this test - the mock upsert isn't being called for unknown reasons
// after migrating from update() to upsert()
it.skip('shows error alert when profile update fails', async () => {

Issue: Mock upsert not being called after migration from update() to upsert()

2. __tests__/components/auth/AppleSignInButton.test.tsx:1274

// TODO: Fix these tests - they were added by CodeRabbit but are not working
// The async flow is not completing properly. Need to investigate mock setup.
describe.skip('Analytics tracking edge cases', () => {

Issue: Async flow not completing properly in mock setup

3. __tests__/components/auth/AppleSignInButton.test.tsx:1324

// TODO: Fix these tests - they were added by CodeRabbit but are not working
// The async flow is not completing properly. Need to investigate mock setup.
describe.skip('Profile update edge cases', () => {

Issue: Same async flow issue as above

Impact

  • Test coverage gaps for critical auth flows
  • Profile update error handling not tested
  • Analytics tracking edge cases not verified

Recommended Approach

  1. Investigate the mock setup for Supabase upsert operations
  2. Check if waitFor or act wrappers are needed for async operations
  3. Verify mock return values match expected Supabase response shape
  4. Consider using jest.useFakeTimers() if timing is an issue

Files Affected

  • __tests__/app/onboarding.test.tsx
  • __tests__/components/auth/AppleSignInButton.test.tsx

Effort Estimate

Low - Likely mock configuration issues


Related to: #133 (Daily Codebase Review - 2025-12-11)

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenticationAuthentication related issuestestingTesting related changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions