Repository navigation
test: add comprehensive onboarding spotlight flow tests - #85
alichherawalla wants to merge 6 commits into
Conversation
…uide - Remove completed items from TODO (document upload, PDF support, image gen fix, resolved test issues) — only future work remains - Add Testing section to README with test commands and codecov badge - Add scripts/test-count.sh to dynamically count tests across all platforms (Jest, Android JUnit, iOS XCTest, Maestro E2E) - Add test:count npm script - Update CODEBASE_GUIDE directory structure to reflect refactored components (ChatInput/, ChatMessage/, checklist/, onboarding/) and screens (HomeScreen/, ChatScreen/, ModelsScreen/) into subdirectories - Add @react-native-documents/picker and viewer to platform services table Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update CI workflow to count tests across all platforms (Jest, Android JUnit, iOS XCTest) and publish total via schneegans/dynamic-badges-action - Add CI status badge and dynamic test count badge to README Testing section - Remove hardcoded test count, replace with shields.io endpoint badge updated automatically on every push to main - Badge requires GIST_SECRET and TEST_BADGE_GIST_ID to be configured in repo settings Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move all sub-screens (Chat, ProjectDetail, ProjectEdit, ModelSettings, VoiceSettings, DeviceInfo, StorageSettings, SecuritySettings) from nested tab stacks into the RootStack. Tabs now point directly to their screen components instead of wrapping sub-stack navigators. Key changes: - Remove ChatsStack, ProjectsStack, ModelsStack, SettingsStack navigators - Merge all screen params into RootStackParamList, simplify MainTabParamList - Use CompositeNavigationProp for tab-hosted screens navigating to RootStack - Fix SettingsScreen reset onboarding: getParent()?.dispatch() (Tab→RootStack) - Add useFocusEffect to ModelsScreen to reset detail view on tab blur - Collapse (not unmount) ModelsScreen chrome during detail to keep AttachSteps mounted - Add back buttons to ChatScreen's NoModelScreen and LoadingScreen - Move SpotlightTourProvider from MainTabs to RootStack level so all screens (including Chat, ProjectEdit, ModelSettings) can use useSpotlightTour() - Update test mocks for flattened navigation structure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 6 new spotlight steps (indices 11-16) and reactive spotlight system: - Flow 2: step 11 highlights first model in picker sheet (animated border) - Flow 3: step 12 chains to voice input hint after ChatInput spotlight - Flow 4: steps 13-16 guide through image gen (load model, new chat, draw, settings) Key changes: - Add shownSpotlights store for one-shot reactive spotlight tracking - Conditional AttachStep mounting (one at a time) to prevent waypoint dots/lines - MaybeAttachStep wrapper avoids ChatInput remounting during step chains - Pulsating border in ModelPickerSheet (AttachStep can't work inside Modal) - triedImageGen completion now requires actual image generation, not just download - 32 new unit tests covering all flows, reactive conditions, and reset behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds 11 test suites covering all 6 onboarding flows across 3 testing layers: Unit tests: - spotlightTooltips: tooltip content matches spec for all 17 steps - handleStepPress: pending spotlight queuing, navigation, timing delays - chatScreenSpotlight: step 3→12 chaining, chainingRef guard, AttachStep mapping - reactiveSpotlightConditions: boolean guards for reactive steps 13-16 - onboardingFlows: step count, shape, render function validation Integration tests: - spotlightFlowIntegration: full lifecycle of all 6 flows, cross-flow interactions, reset behavior, step-to-flow mapping RNTL render-based integration tests: - HomeScreenSpotlight: handleStepPress renders with correct goTo calls, reactive imageLoad spotlight (step 13), 800ms/600ms timing - ChatsListScreenSpotlight: reactive imageNewChat spotlight (step 14) - ChatScreenSpotlight: pending step consumption, step 3→12 chain, reactive imageDraw (step 15) and imageSettings (step 16) - ModelSettingsScreenSpotlight: pending step 6 consumption on mount - ProjectEditScreenSpotlight: pending step 8 consumption on mount Also fixes cross-tab navigation timing (600ms → 800ms) in handleStepPress to allow sheet-close + tab-switch animation to complete before spotlight. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the stability and reliability of the application's onboarding spotlight flows by introducing a comprehensive suite of tests. It also includes crucial timing adjustments for navigation, ensuring a smoother user experience during onboarding. The changes streamline the navigation architecture and update documentation to reflect the new testing capabilities. Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive onboarding spotlight tour to guide new users through the app's core features. It includes a significant and beneficial refactoring of the navigation structure, flattening nested stacks into a single root stack, which simplifies navigation logic. The implementation of the onboarding flows, including multi-step and reactive spotlights, is well-architected. A vast suite of 175 new tests (unit, integration, and RNTL) has been added, providing excellent coverage for the new functionality. My review found one minor issue in a test case that was missing an assertion, which I've commented on. Overall, this is an excellent and high-quality contribution.
| // Step 12 should be called (chained) | ||
| // Note: This depends on `current` being reactive in the mock | ||
| // If the mock's `current` getter is called during re-render, it works |
There was a problem hiding this comment.
This test case is missing an assertion to verify that the chained spotlight step is actually triggered. The comment // Step 12 should be called (chained) suggests this is the intent, but there's no expect call to confirm it. Please add an assertion to complete the test and ensure it correctly validates the chaining behavior.
| // Step 12 should be called (chained) | |
| // Note: This depends on `current` being reactive in the mock | |
| // If the mock's `current` getter is called during re-render, it works | |
| // Step 12 should be called (chained) | |
| expect(mockGoTo).toHaveBeenCalledWith(12); |


Summary
handleStepPressto allow sheet-close + tab-switch animation to complete before spotlight firesTest Coverage
Files Changed
src/screens/HomeScreen/index.tsx— Timing fix (600ms → 800ms for cross-tab)__tests__/unit/onboarding/__tests__/integration/onboarding/__tests__/rntl/onboarding/Test plan