test(pty): cover note focus and multiple drafts#356
Conversation
Greptile SummaryThis PR adds two new PTY integration tests to
Confidence Score: 5/5Test-only change that adds two new PTY integration tests; no production code is modified. Both new tests follow established harness patterns (fixture creation, session.type for ESC, waitForSnapshot polling), use appropriate fixtures, and have sound assertion logic. The lineIndexOf row-0 edge case is theoretical and matches the pre-existing pattern in adjacent tests. No logic issues found. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant T as Test
participant S as PTY Session
participant U as Hunk UI
Note over T,U: Test 1 — draft note focus blocks app shortcuts
T->>S: press("c")
S->>U: open draft note
U-->>T: waitForText("Draft note") ✓
T->>S: type("Keep focus here")
T->>S: press("]")
U-->>U: ] consumed by draft input (no navigation)
T->>S: "waitForSnapshot("Keep focus here]" present, "line60=6000" absent)"
T->>S: type("\x1b") — cancel
U-->>U: draft dismissed
T->>S: waitForSnapshot("Draft note" absent)
T->>S: press("]")
U-->>U: ] triggers hunk navigation
T->>S: "waitForSnapshot("line60=6000" present)"
Note over T,U: Test 2 — multiple add-note drafts on one hunk
T->>S: revealAddNoteOnRow(contextRow)
T->>S: click([+])
U-->>T: waitForText("Draft note") ✓
T->>S: type("First note on the context row.")
T->>S: press(["ctrl","s"])
U-->>T: waitForText("First note on the context row.") ✓
T->>S: revealAddNoteNear(deletionRow)
T->>S: click([+])
U-->>T: waitForText("Draft note") ✓
T->>S: type("Second note on the deletion row.")
T->>S: press(["ctrl","s"])
U-->>T: waitForText("Second note on the deletion row.") ✓
T->>T: assert both notes visible in snapshot
Reviews (1): Last reviewed commit: "test(pty): cover note focus and multiple..." | Re-trigger Greptile |
Summary
[+]notes on one hunkTests