Dev #11
@@ -61,7 +61,7 @@ def render_scene_object(obj):
|
||||
f'<div class="dialogueBoxWidget" data-object-id="{obj["id"]}" data-element-id="{obj["id"]}" style="{box_style}">'
|
||||
f'<div class="dialogueBoxHeader" data-dialogue-role="header" style="background:{html_lib.escape(style["header_bg"])}">Nom du personnage</div>'
|
||||
f'<div class="dialogueBoxBody" data-dialogue-role="body" style="background:{html_lib.escape(style["body_bg"])}">Le texte du dialogue s\'affiche ici.</div>'
|
||||
f'<div class="dialogueBoxFooter" style="background:{html_lib.escape(style["footer_bg"])}">'
|
||||
f'<div class="dialogueBoxFooter" data-dialogue-role="footer" style="background:{html_lib.escape(style["footer_bg"])}">'
|
||||
f'<button type="button" class="dialogueBoxNextBtn" data-dialogue-role="next-btn" onclick="forgeDialogueBoxAdvance({obj["id"]})">Suivant →</button>'
|
||||
f'</div></div>'
|
||||
)
|
||||
|
||||
@@ -42,6 +42,15 @@ def test_render_dialogue_box_has_header_body_footer(tmp_game_slug_cleanup):
|
||||
assert "dialogueBoxBody" in html
|
||||
assert "dialogueBoxFooter" in html
|
||||
assert f'data-object-id="{obj_id}"' in html
|
||||
# Bug corrigé : le footer n'avait PAS data-dialogue-role="footer" (seul
|
||||
# son bouton "Suivant" interne l'avait, sous "next-btn") — le JS
|
||||
# (forgeShowQuestOffer, static/js/play/dialogue-box-controller.js) le
|
||||
# cherche par ce sélecteur pour y injecter Accepter/Refuser en fin de
|
||||
# dialogue d'une quête "nouvelle" ; sans lui, l'écran d'offre gardait
|
||||
# silencieusement le bouton "Suivant" au lieu des deux nouveaux boutons.
|
||||
assert 'data-dialogue-role="header"' in html
|
||||
assert 'data-dialogue-role="body"' in html
|
||||
assert 'data-dialogue-role="footer"' in html
|
||||
|
||||
|
||||
def test_set_scene_object_dialogue_box_style_persists_and_sanitizes(tmp_game_slug_cleanup):
|
||||
|
||||
Reference in New Issue
Block a user