Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions priv/fixtures/library_loan.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,23 @@
}
]
}
},
{
"type": "core.drafts",
"id": "blk_ll_drafts",
"type_version": 1,
"slots": {
"body": [
{
"type": "core.send",
"id": "blk_ll_second_notice",
"type_version": 1,
"config": {
"event": "loan.overdue"
}
}
]
}
}
]
}
Expand Down
5 changes: 4 additions & 1 deletion test/statifier_examples/view_model_pin_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ defmodule StatifierExamples.ViewModelPinTest do

# The library world. Each branch keeps every arm it declares, the empty
# one included - an empty slot has no row, because a slot is not a block.
"library_loan" => {10, %{step: 4, arm: 4, rail: 2}},
# 2026-09-30: the loan's drafts shelf adds two rows, the shelf itself as
# a step at the root and the draft on it as a tray; the shelf is there so
# a library-world page draws a tray.
"library_loan" => {12, %{step: 5, arm: 4, rail: 2, tray: 1}},
"patron_registration" => {11, %{step: 6, arm: 3, rail: 2}}
}

Expand Down
12 changes: 10 additions & 2 deletions test/statifier_examples_web/live/plan_description_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule StatifierExamplesWeb.PlanDescriptionLiveTest do
alias StatifierExamplesWeb.EventPhrasing

@library ["library_loan", "patron_registration"]
@kinds ~w(block rule arm undecided_arm rules marker start edge interrupt timer)
@kinds ~w(block rule arm undecided_arm rules marker start edge interrupt timer tray)

@region "#plan-description"
@store "#plan-description-store"
Expand Down Expand Up @@ -257,11 +257,14 @@ defmodule StatifierExamplesWeb.PlanDescriptionLiveTest do

describe "the store" do
# Every element the map draws is described on the page, under the map's
# own id, and the two library fixtures between them draw every kind.
# own id, and the two library fixtures between them draw every kind. The
# loan's drafts shelf is what draws the tray.
#
# Sabotage: gave the page's `description_region` a different id from
# the one its map region names (`plan-description-x`); the store moved
# off `#plan-description-store` and this went red. Reverted from a copy.
# Took the drafts shelf out of `library_loan.json`; this went red on
# "no tray on the page". Reverted from a copy.
test "describes every drawn element on the two fixtures", %{conn: conn} do
kinds =
for key <- @library, reduce: MapSet.new() do
Expand Down Expand Up @@ -309,6 +312,11 @@ defmodule StatifierExamplesWeb.PlanDescriptionLiveTest do

assert stored_text(patron, "blk_pr_age/otherwise/empty") =~ "the end of Branch"
assert stored_text(patron, "blk_pr_deadline") =~ "7d"

assert stored_text(loan, "blk_ll_drafts/body") =~
"Kept to one side: the steps here are not part of the flow"

assert stored_text(loan, "blk_ll_second_notice") =~ "kept to one side in Drafts"
end

# The store follows the document: a write through the list reaches it.
Expand Down
Loading