Skip to content

tests(SF2.0): Extract shared journey abstraction for UpcomingDeparturesTest#3074

Merged
joshlarson merged 53 commits intomainfrom
jdl/sf2.0/cleanup-tests
Apr 7, 2026
Merged

tests(SF2.0): Extract shared journey abstraction for UpcomingDeparturesTest#3074
joshlarson merged 53 commits intomainfrom
jdl/sf2.0/cleanup-tests

Conversation

@joshlarson
Copy link
Copy Markdown
Contributor

Scope

This PR exists because while trying to fix a (relatively minor) bug, I accidentally introduced a few more, which none of the tests caught. The tests have become difficult enough to work with that I couldn't even figure out a way to validate the behavior that I broke without introducing potentially hundreds of additional lines of test code.

Asana Ticket: [SF2.0/TechDebt] Clean up UpcomingDeparturesTest

Implementation

  • This hopefully cleans up the UpcomingDeparturesTest module (and maybe TripDetailsTest, although maybe that cleanup should get punted to a different PR) by taking all of the shared inherent complexity of creating matching schedules and predictions, and shoving that complexity into a PredictedScheduleHelper module.

@joshlarson joshlarson changed the title Jdl/sf2.0/cleanup tests tests(SF2.0): Extract shared journey abstraction for UpcomingDepar… c8210cc …turesTest Apr 1, 2026
@joshlarson joshlarson changed the title tests(SF2.0): Extract shared journey abstraction for UpcomingDepar… c8210cc …turesTest tests(SF2.0): Extract shared journey abstraction for UpcomingDeparturesTest Apr 1, 2026
@joshlarson joshlarson marked this pull request as ready for review April 3, 2026 03:59
@joshlarson joshlarson requested a review from a team as a code owner April 3, 2026 03:59
@joshlarson joshlarson requested a review from thecristen April 3, 2026 03:59
Copy link
Copy Markdown
Collaborator

@thecristen thecristen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this is a great step forward for these tests.

Comment thread test/support/predicted_scheduler_helper.ex
Comment thread test/support/predicted_scheduler_helper.ex Outdated
Comment thread test/support/predicted_scheduler_helper.ex Outdated
Comment thread test/support/predicted_scheduler_helper.ex Outdated
Comment thread test/dotcom/schedule_finder/upcoming_departures_test.exs
@joshlarson joshlarson requested a review from thecristen April 7, 2026 15:49
@joshlarson joshlarson enabled auto-merge (squash) April 7, 2026 20:58
Copy link
Copy Markdown
Collaborator

@thecristen thecristen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@joshlarson joshlarson merged commit fdbb47d into main Apr 7, 2026
17 checks passed
@joshlarson joshlarson deleted the jdl/sf2.0/cleanup-tests branch April 7, 2026 21:13
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.

2 participants