diff --git a/templates/partials/communication_preferences_fields.html b/templates/partials/communication_preferences_fields.html index 928c6bc..14d60a4 100644 --- a/templates/partials/communication_preferences_fields.html +++ b/templates/partials/communication_preferences_fields.html @@ -54,23 +54,15 @@ return; } - function syncSubPreferences() { + master.addEventListener('change', function () { if (master.checked) { subPrefs.style.display = ''; + updates.checked = true; } else { subPrefs.style.display = 'none'; updates.checked = false; marketing.checked = false; } - } - - master.addEventListener('change', function () { - if (master.checked) { - subPrefs.style.display = ''; - updates.checked = true; - } else { - syncSubPreferences(); - } }); }); })(); diff --git a/tests/routers/core/test_account.py b/tests/routers/core/test_account.py index 22548a9..382c40a 100644 --- a/tests/routers/core/test_account.py +++ b/tests/routers/core/test_account.py @@ -450,6 +450,9 @@ def test_register_page_shows_password_requirements(unauth_client: TestClient): assert 'name="comm_opt_in"' in html assert 'name="comm_updates"' in html assert 'name="comm_marketing"' in html + + +def test_register_page_confirm_password_has_autocomplete(unauth_client: TestClient): """Issue #156: Both password fields must have autocomplete='new-password' for Chrome autofill.""" response = unauth_client.get(app.url_path_for("read_register")) assert response.status_code == 200