Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion test/statifier_blocks/map_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,16 @@ defmodule StatifierBlocks.MapTest do
# timer edge still runs to the await that hears its event, and nothing
# runs to the wait.
#
# A wait's schema has no event field, so a wait built from config alone
# could never pair with the send even if the map counted it a timer
# target. The wait is given the send's event on its form here, so the
# edge half bites: a wait that joined the timer targets would hear it.
#
# Sabotage: made mark/1 answer "wait" for core.wait; this went red.
# Reverted from a copy.
#
# Sabotage: added core.wait to @timer_targets; this went red.
# Reverted from a copy.
test "a wait carries the clock mark and hears no timer edge" do
root =
Block.new("core.sequence",
Expand All @@ -647,7 +655,23 @@ defmodule StatifierBlocks.MapTest do
}
)

graph = root |> Document.new() |> build() |> BlockMap.graph()
view_model = root |> Document.new() |> build()
[%{children: [send, wait, await]} = body] = view_model.root.slots

event = %ViewModel.Field{
key: "event",
type: :string,
label: "Event",
required?: false,
default: nil,
value: "loan.overdue"
}

heard = %{wait | form: %{wait.form | fields: [event | wait.form.fields]}}
body = %{body | children: [send, heard, await]}
view_model = %{view_model | root: %{view_model.root | slots: [body]}}

graph = BlockMap.graph(view_model)

assert marks(graph) == %{
"reminder" => "clock",
Expand Down
Loading