From 0a304c88aab9d423d9510219d053cca6b8523c73 Mon Sep 17 00:00:00 2001 From: JohnnyT Date: Wed, 30 Sep 2026 04:54:25 -0600 Subject: [PATCH] Adds a drafts shelf to the library loan fixture No library-world fixture had a drafts shelf, so no Plan page test proved a tray reaches the description store. The loan now parks a second overdue notice on a shelf at its root, the store test counts tray among the kinds the two library fixtures draw, and the facts test checks the tray's and the parked step's words. The outline pin counts the two new rows. Refs: se-8lxc --- priv/fixtures/library_loan.json | 17 +++++++++++++++++ test/statifier_examples/view_model_pin_test.exs | 5 ++++- .../live/plan_description_live_test.exs | 12 ++++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/priv/fixtures/library_loan.json b/priv/fixtures/library_loan.json index f5e16a4..da9d74c 100644 --- a/priv/fixtures/library_loan.json +++ b/priv/fixtures/library_loan.json @@ -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" + } + } + ] + } } ] } diff --git a/test/statifier_examples/view_model_pin_test.exs b/test/statifier_examples/view_model_pin_test.exs index 39ce727..a8bcc60 100644 --- a/test/statifier_examples/view_model_pin_test.exs +++ b/test/statifier_examples/view_model_pin_test.exs @@ -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}} } diff --git a/test/statifier_examples_web/live/plan_description_live_test.exs b/test/statifier_examples_web/live/plan_description_live_test.exs index 787b637..9c7a860 100644 --- a/test/statifier_examples_web/live/plan_description_live_test.exs +++ b/test/statifier_examples_web/live/plan_description_live_test.exs @@ -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" @@ -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 @@ -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.