Skip to content

test: add unit and component tests for OnboardingModal #133 - #155

Merged
GiZano merged 1 commit into
ClimbStack:mainfrom
Gheb6:feat/onboarding-modal-component-tests
Oct 12, 2026
Merged

GiZano merged 1 commit into
ClimbStack:mainfrom
Gheb6:feat/onboarding-modal-component-tests

Conversation

@Gheb6

@Gheb6 Gheb6 commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Description

Adds comprehensive unit and component tests for src/components/OnboardingModal.tsx using Jest and React Native Testing Library, bringing coverage for the component to 100%.

  • Verifies modal visibility props, slide animations, and null return when visible={false}.
  • Tests proper application of light and dark theme colors to text, background, buttons, and pagination dots.
  • Tests rendering of all 5 tutorial slides (titles, localized descriptions, and images with resizeMode="contain").
  • Verifies FlatList properties, viewability threshold, and keyExtractor.
  • Tests user interactions: pressing "Skip" and the final "Start Climbing" button to trigger onDismiss.
  • Tests pagination changes via onViewableItemsChanged, active dot indicator states, and edge cases (empty viewable items, undefined indices).

Related Issues

Testing Instructions

  1. Run the test suite:
    npx jest src/components/__tests__/OnboardingModal.test.tsx

Add unit and component tests for src/components/OnboardingModal.tsx using Jest and React Native Testing Library.

- Verify modal visibility, slide animation, and null state when not visible
- Test SafeAreaView and element styling across light and dark themes
- Verify all tutorial slides render titles, descriptions, and images with proper resizeMode
- Test FlatList configuration, paging props, and keyExtractor
- Test Skip button and final Start Climbing button press dismissal
- Test onViewableItemsChanged pagination updates, active dot states, and edge cases
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@GiZano
GiZano merged commit d28e3ee into ClimbStack:main Oct 12, 2026
4 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.

[FEAT] Add tests for src/components/OnboardingModal.tsx

2 participants