Skip to content

fix: restore autocomplete regression test + simplify communication preferences JS#197

Merged
chriscarrollsmith merged 2 commits into
mainfrom
fix/restore-autocomplete-test
Jun 23, 2026
Merged

fix: restore autocomplete regression test + simplify communication preferences JS#197
chriscarrollsmith merged 2 commits into
mainfrom
fix/restore-autocomplete-test

Conversation

@chriscarrollsmith

@chriscarrollsmith chriscarrollsmith commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Two small, related cleanups to the communication-preferences feature added in #195:

  1. Restore the confirm-password autocomplete regression test. add communication preferences #195 accidentally deleted the def line for test_register_page_confirm_password_has_autocomplete, collapsing its body into test_register_page_shows_password_requirements and demoting its docstring to a no-op string statement. The issue "Register" page must document the security policy #156 autocomplete check is restored as its own test. The comm-preference assertions remain in test_register_page_shows_password_requirements, where they correctly verify the register page renders the new fields.

  2. Drop the syncSubPreferences helper. In communication_preferences_fields.html the helper was only ever called from the master checkbox's change handler (disable branch) and never on init — initial visibility is already set server-side via the Jinja style="display: none;" guard. Inlining it removes the indirection and the enable/disable asymmetry. Behavior is preserved exactly: enabling reveals the sub-preferences and checks comm_updates; disabling hides them and clears both sub-preferences.

Test plan

  • uv run pytest tests/routers/core/test_account.py (91 passed)
  • uv run pytest tests/test_templates.py (30 passed)
  • Both test_register_page_shows_password_requirements and test_register_page_confirm_password_has_autocomplete are collected as separate tests
  • uv run ty check . clean

chriscarrollsmith and others added 2 commits June 23, 2026 11:02
PR #195 accidentally deleted the def line for
test_register_page_confirm_password_has_autocomplete, collapsing its
body into test_register_page_shows_password_requirements and demoting
its docstring to a no-op string statement. This restored the issue #156
autocomplete check as its own test.

Co-authored-by: Cursor <cursoragent@cursor.com>
The syncSubPreferences helper was only invoked from the master
checkbox's change handler (disable branch) and never on init, where
initial visibility is already set server-side via Jinja. Inlining it
removes the indirection and the asymmetry between the enable and
disable paths while preserving behavior: enabling reveals the
sub-preferences and checks updates; disabling hides them and clears
both sub-preferences.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chriscarrollsmith chriscarrollsmith changed the title fix: restore confirm-password autocomplete regression test fix: restore autocomplete regression test + simplify communication preferences JS Jun 23, 2026
@chriscarrollsmith chriscarrollsmith merged commit 431c964 into main Jun 23, 2026
2 checks passed
@chriscarrollsmith chriscarrollsmith deleted the fix/restore-autocomplete-test branch June 23, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant