Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Add SearchStopViewModel tests and fake stop finder response builder #527

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Jan 10, 2025

TL;DR

Added test coverage for SearchStopViewModel and enhanced FakeAnalytics tracking capabilities

What changed?

  • Enhanced FakeAnalytics to store and retrieve complete AnalyticsEvent objects instead of just event names
  • Created FakeStopFinderResponseBuilder to generate test data for stop finder responses
  • Updated FakeTripPlanningService to use the new response builder
  • Added comprehensive test suite for SearchStopViewModel covering:
    • Initial state and screen view analytics
    • Search functionality with success and failure scenarios
    • Stop selection analytics tracking

How to test?

  1. Run the test suite in SearchStopViewModelTest
  2. Verify all tests pass, including:
    • Initial UI state validation
    • Search functionality with success/failure cases
    • Analytics tracking for screen views and stop selections
    • Error state handling

Why make this change?

To ensure reliable behavior of the SearchStopViewModel through comprehensive test coverage, particularly focusing on user interactions, API responses, and analytics tracking. This change improves the overall reliability and maintainability of the search stop feature.

@ksharma-xyz ksharma-xyz changed the title Add UT for SearchStopViewModel Test: Add SearchStopViewModel tests and fake stop finder response builder Jan 10, 2025
@ksharma-xyz ksharma-xyz marked this pull request as ready for review January 10, 2025 05:34
Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ksharma-xyz ksharma-xyz merged commit 333f94d into main Jan 10, 2025
4 checks passed
Copy link
Owner Author

Merge activity

  • Jan 10, 12:45 AM EST: A user merged this pull request with Graphite.

@ksharma-xyz ksharma-xyz deleted the 01-10-add_ut_for_searchstopviewmodel branch January 10, 2025 05:45
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.

1 participant