Files
flowdeck/tests/test_v766_slash_esc_comment_btn.py
bruno db6bf03a00
FlowDeck CI / lint (push) Canceled after 0s
FlowDeck CI / test (push) Canceled after 0s
FlowDeck CI / docker (push) Canceled after 0s
fix: icône du bouton « commenter » = bulle Feather + (message-square) (v7.66.0)
Chemin SVG dessiné à la main remplacé par le message-square éprouvé de Feather
(viewBox 24) + un « + » centré dans la bulle — même famille de traits que les
autres icônes outline de l'éditeur. Le test statique suit.

Gates: pytest tests/ -q -n auto → 1386 passed (1 flake connu et non lié
test_v55::TestOGParser::test_fetch_og_metadata_success : échoue parfois sous
-xdist, passe seul et passe au run complet final) ; ruff OK ;
e2e v766 (2) + v764 (1) → 3 passed sur :8081 (image flowdeck:v7.66.0
rebuild + redéployée).
2026-10-08 13:09:22 -04:00

42 lines
2.1 KiB
Python

"""7.66.0 — Escape du menu slash retire le « / » + bouton commenter à droite du bloc."""
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
EDITOR_JS = (ROOT / "static" / "js" / "page_editor_scripts.js").read_text(encoding="utf-8")
APP_CSS = (ROOT / "static" / "css" / "app.css").read_text(encoding="utf-8")
def test_slash_escape_removes_the_slash():
# une seule implémentation, appelée par les deux chemins (focus dans le bloc
# → onKd ; focus dans l'entrée du menu → listener document)
assert "escClose(){" in EDITOR_JS
assert EDITOR_JS.count("SM.escClose();") == 2
# ne retire que le « / » d'ouverture, remet le caret et sauvegarde
assert "n.nodeValue=v.slice(0,at)+v.slice(at+1);" in EDITOR_JS
assert "E.sync();E.dirty=true;E.autoSave();" in EDITOR_JS
def test_comment_button_on_the_right_of_the_block():
# émis APRÈS le contenu du bloc → à droite dans le flex du wrapper
i_tpl = EDITOR_JS.index("const cmtBtn=")
i_content = EDITOR_JS.index('class="${cls}">${inner}</${tag}>', i_tpl)
i_btn = EDITOR_JS.index("${cmtBtn}", i_tpl)
assert i_content < i_btn
# icône bulle de conversation +, ancre = commentaire du bloc
assert 'onclick="E.commentBlock(${idx})"' in EDITOR_JS
assert EDITOR_JS.count('<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5') == 1 # bulle (message-square)
assert '<path d="M12 8v5M9.5 10.5h5"/>' in EDITOR_JS # le + dans la bulle
# l'ancien .block-actions mort (opacity:0 sans survol) a disparu de renderBlock
assert "const actions=idx>=0?" not in EDITOR_JS
def test_comment_button_style_and_visibility():
assert ".block-comment-btn {" in APP_CSS
assert "right: -60px;" in APP_CSS # gouttière 64px, comme .block-actions
assert ".block-wrapper:hover .block-comment-btn," in APP_CSS
assert ".block-comment-btn:hover {" in APP_CSS
# masqué partout où le handle l'est : mobile (2 breakpoints) + page verrouillée
assert APP_CSS.count(".block-comment-btn { display: none; }") == 2
assert "body.page-locked .block-comment-btn," in APP_CSS