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

Change time to display "BRD" to <60 seconds until departure at terminals #861

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

robbie-sundstrom
Copy link
Contributor

Summary of changes

Asana Ticket: Change terminals "BRD" time to 60 seconds

When a train is at the terminal, this will change sign from displaying "1 min" to "BRD" when the departure time prediction goes below 60 seconds.

Reviewer Checklist

  • Meets ticket's acceptance criteria
  • Any new or changed functions have typespecs
  • Tests were added for any new functionality (don't just rely on Codecov)
  • If signs.json was changed, there is a follow-up PR to signs_ui to update its dependency on this project
  • This branch was deployed to the staging environment and is currently running with no unexpected increase in warnings, and no errors or crashes (compare on Splunk: staging vs. prod)

@robbie-sundstrom robbie-sundstrom requested a review from a team as a code owner December 19, 2024 19:01
@@ -215,9 +215,25 @@ defmodule Content.Message.PredictionsTest do
assert Content.Message.to_string(msg) == "Ashmont BRD"
end

test "does not put boarding on the sign too early when train is stopped at terminal" do

test "put boarding on the sign when train is stopped at terminal and departing in less than 60 seconds" do
Copy link
Collaborator

Choose a reason for hiding this comment

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

These lower level tests are fine, but they tend to be more brittle in the face of refactoring. Instead, we could add a pair of cases in realtime_test.exs to exercise this at a higher level, and it should be about the same cost code-wise. If you want to give that a try, take a look at some of the examples there. There's a @terminal_sign struct that's already set up with a terminal configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't been able to get a specific test case work in realtime_test, but I've learned a lot about the Elixir test setup by trying to get this work! Will follow up on Monday to try to get it all working

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course I figured it out as soon as I got up. There are new tests in realtime_test.exs now!

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