fix: nav/footer wireframe, honeypot CSP, explore topics, comment E2E coverage
- Replace nav inline newsletter form with Subscribe CTA link per wireframe - Remove newsletter form from footer; add Connect section with social/RSS links - Fix honeypot inputs using hidden attribute (inline style blocked by CSP) - Add available_tags to HomePage.get_context for Explore Topics section - Add data-comment-form attribute to main comment form for reliable locating - Seed approved comment in E2E content for reply flow testing - Expand test_comments.py: moderation message, not-immediately-visible, missing fields, reply form visible, reply submission - Make COMMENT_RATE_LIMIT_PER_MINUTE configurable; set 100 in dev to prevent E2E test exhaustion; update rate limit unit test with override_settings - Update newsletter/home E2E tests to reflect nav form removal - Update unit test to assert no nav/footer newsletter forms Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,8 @@ from playwright.sync_api import Page, expect
|
||||
|
||||
|
||||
def _nav_newsletter_form(page: Page):
|
||||
return page.locator("nav").locator("form[data-newsletter-form]")
|
||||
"""Return the newsletter form in the home page sidebar aside."""
|
||||
return page.locator("aside").locator("form[data-newsletter-form]").first
|
||||
|
||||
|
||||
@pytest.mark.e2e
|
||||
@@ -28,7 +29,7 @@ def test_subscribe_invalid_email_shows_error(page: Page, base_url: str) -> None:
|
||||
form = _nav_newsletter_form(page)
|
||||
# Disable the browser's native HTML5 email validation so the JS handler
|
||||
# fires and sends the bad value to the server (which returns 400).
|
||||
page.evaluate("document.querySelector('nav form[data-newsletter-form]').setAttribute('novalidate', '')")
|
||||
page.evaluate("document.querySelector('aside form[data-newsletter-form]').setAttribute('novalidate', '')")
|
||||
form.locator('input[type="email"]').fill("not-an-email")
|
||||
form.get_by_role("button", name="Subscribe").click()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user