21 lines
761 B
Python
21 lines
761 B
Python
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 "function openSafetyPlan(triggerEl)" in html
|
|
assert "safetyPlanModal.classList.add('active');" in html
|
|
assert "openSafetyPlan(chatSafetyPlanBtn);" in html
|