from tests.conftest import BASE_URL from tests.test_post import create_post POST_PAYLOAD = "XSSPROBE end of post" COMMENT_PAYLOAD = "CMTPROBE end of comment" def test_post_content_is_sanitized(alice): page, _ = alice fired = [] page.on("dialog", lambda d: (fired.append(d.message), d.dismiss())) create_post(page, "random", POST_PAYLOAD) content = page.locator(".post-detail-content") content.wait_for(state="visible") page.locator(".post-detail-content p").first.wait_for(state="visible") html = content.inner_html().lower() assert "