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 isActive flow tests for TimeTableViewModel #523

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

ksharma-xyz
Copy link
Owner

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

TL;DR

Added test coverage for TimeTable's isActive flow and exposed REFRESH_TIME_TEXT_DURATION for testing

What changed?

  • Added new test case to verify TimeTable's isActive flow behavior when journey list is empty
  • Added a placeholder for future test case when journey list is not empty
  • Made REFRESH_TIME_TEXT_DURATION constant visible for testing purposes by adding @VisibleForTesting annotation

How to test?

  1. Run the TimeTableViewModelTest class
  2. Verify that the new test GIVEN journeyList is empty in UI State WHEN REFRESH_TIME_TEXT_DURATION passes THEN updateTimeText is not called passes
  3. Confirm that the REFRESH_TIME_TEXT_DURATION constant is accessible in test classes

Why make this change?

To improve test coverage of the TimeTable feature, specifically around the isActive flow functionality which controls time text updates. This ensures the time-based refresh behavior works correctly when the journey list is empty and sets up structure for testing non-empty journey list scenarios.

@ksharma-xyz ksharma-xyz force-pushed the 01-08-add_ut_for_analytics branch from 1dfe560 to ca7c4fe Compare January 8, 2025 21:55
@ksharma-xyz ksharma-xyz force-pushed the 01-08-add_ut_for_isatcive_flow branch from c04aa00 to 89a7bc0 Compare January 8, 2025 21:55
@ksharma-xyz ksharma-xyz force-pushed the 01-08-add_ut_for_analytics branch from ca7c4fe to 6843440 Compare January 9, 2025 07:23
@ksharma-xyz ksharma-xyz force-pushed the 01-08-add_ut_for_isatcive_flow branch 2 times, most recently from 5f337b3 to e1af3f1 Compare January 9, 2025 07:25
@ksharma-xyz ksharma-xyz marked this pull request as ready for review January 9, 2025 07:25
Base automatically changed from 01-08-add_ut_for_analytics to main January 9, 2025 07:36
@ksharma-xyz ksharma-xyz force-pushed the 01-08-add_ut_for_isatcive_flow branch from e1af3f1 to 533f406 Compare January 26, 2025 23:34
@ksharma-xyz ksharma-xyz enabled auto-merge (squash) January 26, 2025 23:35
@ksharma-xyz ksharma-xyz merged commit 9a3c6d5 into main Jan 26, 2025
2 checks passed
@ksharma-xyz ksharma-xyz deleted the 01-08-add_ut_for_isatcive_flow branch January 26, 2025 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant