From a213248910b945535465a83a416e8d1497b209ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 28 Sep 2026 02:22:34 -0400 Subject: [PATCH] =?UTF-8?q?T42c=20Misc=20=C2=B7=20Codes=20and=20checks=20p?= =?UTF-8?q?asses=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests now hold focus in the field after an answer and a passed captcha with no Tab stop. --- TASKS.md | 4 +++- src/misc/tests/codes.rs | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/TASKS.md b/TASKS.md index 33ab1c7..26868e8 100644 --- a/TASKS.md +++ b/TASKS.md @@ -142,7 +142,7 @@ Per-component lines live in `tasks/`. Tags there: - [x] T41c Maps · World — `tasks/ch31-43.md` - [x] T42a Misc · Time — `tasks/ch31-43.md` - [x] T42b Misc · Numbers — `tasks/ch31-43.md` -- [ ] T42c Misc · Codes and checks — `tasks/ch31-43.md` +- [x] T42c Misc · Codes and checks — `tasks/ch31-43.md` - [ ] T42d Misc · Asking and learning — `tasks/ch31-43.md` - [ ] T42e Misc · Terms and notices — `tasks/ch31-43.md` - [ ] T42f Misc · Web — `tasks/ch31-43.md` @@ -452,3 +452,5 @@ Per-component lines live in `tasks/`. Tags there: | T42a | 2 | PASS | | | T42b | 1 | FAIL | a result went on as its twelve-digit text, so 1 ÷ 3 = × 3 = read 0.999999999999; a long reading hid digits at 280px; Equals on a dangling operator said the formula ended early; Control, the = key and a point after a result untested | | T42b | 2 | PASS | | +| T42c | 1 | FAIL | a verdict or a new ask disabled Verify while it held focus, so focus fell to the root; Enter handed a second answer over during the check; a passed field kept its ring and caret | +| T42c | 2 | PASS | three claims untested; tests for focus after an answer and a resting pass added in the pass commit | diff --git a/src/misc/tests/codes.rs b/src/misc/tests/codes.rs index 5505e10..8d7aadf 100644 --- a/src/misc/tests/codes.rs +++ b/src/misc/tests/codes.rs @@ -163,7 +163,24 @@ fn verify_hands_focus_to_the_field(cx: &mut TestAppContext) { press("tab", cx); press("enter", cx); assert_eq!(said(), ["W7XK"]); - assert!(!at_root(cx), "focus went to the field, not the root"); + cx.simulate_input("again"); + press("enter", cx); + assert_eq!(said(), ["W7XK", "again"], "the typing reached the field"); +} + +/// A passed captcha rests: Tab finds no stop in it and typing reaches nothing. +#[gpui::test] +fn a_passed_captcha_rests(cx: &mut TestAppContext) { + STATE.set(CaptchaState::Passed); + let (_, cx) = stage(captcha, cx); + press("tab", cx); + cx.simulate_input("again"); + press("enter", cx); + assert!(said().is_empty()); + assert!( + !shown("captcha-verified-focused", cx), + "Tab found no stop in the resting captcha" + ); } /// Verify spins while the owner checks, and its mark keeps its focus once passed.