Parcourir la source

test: question-block body above options verified — body + selected answer render after answering (bodies arrive once A2 lands; contract-side covered here)

clanker il y a 1 mois
Parent
commit
d971152ed3
1 fichiers modifiés avec 18 ajouts et 0 suppressions
  1. 18 0
      test/web_stack_test.py

+ 18 - 0
test/web_stack_test.py

@@ -460,6 +460,24 @@ def main():
         check(review_block.get("show_body") is True,
               "answered review shows the body again (banner gone)")
 
+        print("== B2: question block body above options ==")
+        # Contract side (A2 will restore bodies end-to-end): a question
+        # block raised with a heredoc body carries it; the body preview
+        # rides above the options (template order) and survives answering
+        # alongside the selected answer.
+        detail = task_state(auth, plan_task)
+        question = [b for b in detail["blocks"] if b["block_type"] == "question"][0]
+        check(question.get("body") == "# Storage choice"
+              and question.get("show_body") is True,
+              "question block keeps its body markdown with the preview on")
+        act(auth, question["answer_action"], {"option": "SQLite"})
+        detail = task_state(auth, plan_task)
+        question = [b for b in detail["blocks"] if b["block_type"] == "question"][0]
+        check(question.get("answered") is True and question.get("answer") == "SQLite"
+              and question.get("body") == "# Storage choice"
+              and question.get("show_body") is True,
+              "answered question shows body + selected answer")
+
         print("== feature 5: rules ==")
         rules_state = slot_public(auth, "/rules", "rules")
         for name, body in [