test: add chat-header safety plan regression (#38)

This commit is contained in:
Alexander Whitestone
2026-04-17 00:59:21 -04:00
parent 07c582aa08
commit e3bb6b86ee

View File

@@ -0,0 +1,19 @@
from pathlib import Path
INDEX = Path("index.html")
def test_chat_header_has_persistent_safety_plan_button():
html = INDEX.read_text()
assert 'id="chat-header"' in html
assert 'id="chat-safety-plan-btn"' in html
assert 'aria-label="Open My Safety Plan from chat header"' in html
assert 'My Safety Plan' in html
def test_chat_header_button_opens_existing_safety_plan_modal():
html = INDEX.read_text()
assert "var chatSafetyPlanBtn = document.getElementById('chat-safety-plan-btn');" in html
assert "chatSafetyPlanBtn.addEventListener('click'" in html
assert "safetyPlanModal.classList.add('active');" in html
assert "_activateSafetyPlanFocusTrap(chatSafetyPlanBtn);" in html