-
Notifications
You must be signed in to change notification settings - Fork 2
chore(mobile-expo): Unit tests for data layer and critical components #97
Copy link
Copy link
Closed
Description
Background
The Expo watch app should have unit tests for the data layer (Experience/section mapping) and critical components so regressions are caught and behavior is documented. This issue adds those tests. Scope has been expanded to cover all 10 active section types.
Expected outcome
- Unit tests for the Experience fetch and section data layer, covering mapping logic for all 10 section types.
- Unit tests for critical UI or hooks (e.g. section renderer dispatch, nested content resolution).
- Tests run in CI (see chore for CI); no flaky or environment-dependent tests in core paths.
- E2E strategy can be documented as deferred if out of scope.
Acceptance criteria
- Data layer tests: at least one test per fetch path (watch home, experience-by-slug) or mapping logic.
- Mapping tests for each of the 10 section types: VideoHero, MediaCollection, CTA, Text, Video, BibleQuotesCarousel, RelatedQuestions, Card, Section, Container.
- Nested content tests: Section → recursive content, Container → slots → recursive content.
- MediaCollection variant tests (carousel, collection, grid, hero, player).
- SectionDispatcher tests: correct component resolved for each
__typename. - Tests run in CI (via Expo or Jest).
- README or CONTRIBUTING updated with how to run tests.
Possible solution(s)
- Jest or Expo's test runner; mock GraphQL client in data layer tests.
- Keep tests colocated or in
__tests__undermobile/expo. - Use the sample Experience (slug:
easter, documentId:lr6luew6oh4hurag4n8s0ddz) as a fixture for integration-style mapping tests.
References
- Parent: epic(mobile-expo): cross-platform watch app with React Native and Expo #89
- Depends on: feat(mobile-expo): expand data layer for all 10 CMS section types #304 (expanded data layer), feat(mobile-expo): section renderers for all 10 CMS section types #93 (section renderers)
- CONTRIBUTING.md
- AGENTS.md (workflow, tests)
- apps/cms/schema.graphql —
ExperienceSectionsDynamicZoneunion (line 693)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done