-
Notifications
You must be signed in to change notification settings - Fork 11
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
Show diversion diagrams in diversion alerts #2067
Conversation
@@ -0,0 +1,50 @@ | |||
defmodule CMS.Page.DiversionsTest do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 This is really just a copy of the /page/basic_test.exs
. For tests related to the CMS, we have to use the static JSON responses until we rewrite all of the CMS tests.
@@ -11,6 +11,12 @@ defmodule PageTest do | |||
describe "from_api/1" do | |||
test "switches on the node type in the json response and returns the proper page struct" do | |||
assert %Page.Basic{} = Page.from_api(Static.basic_page_response()) | |||
|
|||
diversions_data = | |||
Static.basic_page_response() |> Map.put("field_page_type", [%{"name" => "Diversions"}]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 This is just a hacky way of creating a Diversions page without creating a giant JSON blob like all other CMS test pages.
diversion = Factories.Alerts.Alert.build(:alert, effect: :shuttle) | ||
non_diversion = Factories.Alerts.Alert.build(:alert, effect: :delay) | ||
|
||
Store.update([diversion, non_diversion], nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 We have to use this store until we convert the CMS code to using Mox for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relying on perfectly titled/named files is always risky, but it is an easy hack for now.
763122d
to
e4bc4b8
Compare
afa9b7a
to
db435f6
Compare
https://app.asana.com/0/555089885850811/1207209404321117/f