From 2295b200a68c7b4d94426aa88fb14455d2633e90 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sat, 3 Oct 2026 17:36:15 +0000 Subject: [PATCH] Test the required form choices (section 24.1) --- tests/test_health_check_form.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_health_check_form.py b/tests/test_health_check_form.py index 9044290..a0ae6bb 100644 --- a/tests/test_health_check_form.py +++ b/tests/test_health_check_form.py @@ -108,6 +108,26 @@ class HealthCheckFormTests(unittest.TestCase): self.assertIn("compatibilityDerived", script) self.assertIn('softwareCompatibilitySelect.value = "OK"', script) + def test_form_requires_hardware_works_and_the_contact_confirmation(self): + html = read_static("health-check.html") + script = read_static("health-check.js") + # Hardware works is a required choice for an available hardware key + # (section 24.1), so the placeholder is not an answer. + self.assertIn("hardwareWorksOptions", script) + self.assertIn('["", "Select status"]', script) + self.assertIn('makeSelect(hardwareWorksOptions, "hardware_works")', script) + self.assertNotIn("booleanOptions", script) + # The required flag is cleared when the key was not available, because a + # hidden required control would block the submission. + self.assertIn( + '["hardware_works", "seed_backup_verified", "address_path_verified"]', + script, + ) + # The confirmation is required in the markup, with the same placeholder, + # and it has no "not assessed" value. + self.assertIn('name="contact_info_verified" required', html) + self.assertNotIn("Not assessed", html) + def test_form_asks_about_the_selected_key_holder_and_reminds_about_updates(self): html = read_static("health-check.html") script = read_static("health-check.js")