mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-10 04:09:53 -06:00
#1537: review — the text-only paste test checks the destination's own formatting stays (CodeRabbit)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
97c72d9063
commit
3e236af3e7
@@ -4166,6 +4166,8 @@ fn ctrl_shift_v_without_copied_formatting_pastes_text_only() {
|
||||
a.run("format.bold", json!({})).unwrap();
|
||||
a.run("edit.copy", json!({})).unwrap();
|
||||
a.run("select.text", json!({"text": "plain"})).unwrap();
|
||||
// The destination has formatting of its own, so a paste that dropped it would show.
|
||||
a.run("format.italic", json!({})).unwrap();
|
||||
assert!(a.session.painter.is_none());
|
||||
let mut h = harness(a);
|
||||
h.run_steps(6);
|
||||
@@ -4175,6 +4177,8 @@ fn ctrl_shift_v_without_copied_formatting_pastes_text_only() {
|
||||
assert_eq!(body_text(h.state()), "Bold Bold", "the clipboard text replaced the selection");
|
||||
let bold = h.state_mut().run("format.state", json!({})).unwrap().get("bold").and_then(Value::as_bool);
|
||||
assert_ne!(bold, Some(true), "the pasted text took the destination's formatting, not the copied bold");
|
||||
let italic = h.state_mut().run("format.state", json!({})).unwrap().get("italic").and_then(Value::as_bool);
|
||||
assert_eq!(italic, Some(true), "the pasted text kept the destination's italic");
|
||||
}
|
||||
|
||||
/// #1669: with Shift held, Backspace still erases (#707) and Delete cuts the selection, doing
|
||||
|
||||
Reference in New Issue
Block a user