forge
Explore
Log in

Don't you dare go Hollow

🧪 cover Darkroom preview scrub

Browse files at this commit

ca9d55a321849bf2990bc9baecb5ed8625b65260Ahmet Kaan GümüşParent: 3e04aeb
  • test
    • 🧪 cover Darkroom preview scrub
Show full message
test(ui): 🧪 cover Darkroom preview scrub
crates/app/src/tests/cards.rsmodified+30 -0
@@ -2043,3 +2043,33 @@ fn a_maximized_card_reopens_exactly_as_left_across_a_restart() {
2043 unsafe { std::env::remove_var("XDG_CONFIG_HOME") };2043 unsafe { std::env::remove_var("XDG_CONFIG_HOME") };
2044 std::fs::remove_dir_all(&dir).ok();2044 std::fs::remove_dir_all(&dir).ok();
2045 }2045 }
2046+
2047+/// Source preview must retain the mouse doors beside its `esc` stop chord:
2048+/// `screen` routes the Darkroom through `picture_area`, and that shared
2049+/// picture mounts the scrub bar whose press starts the root-tracked drag.
2050+#[test]
2051+fn darkroom_preview_mounts_stop_and_drag_scrub() {
2052+ let stance = src_text("ui/stance.rs");
2053+ let screen = &stance[stance.find("fn screen(").expect("the Darkroom screen")..];
2054+ assert!(
2055+ screen.contains(".children(player.preview_plate(cx))"),
2056+ "the Darkroom screen no longer mounts the preview Stop plate"
2057+ );
2058+ assert!(
2059+ screen.contains(".child(player.picture_area(position, window, cx))"),
2060+ "the Darkroom screen no longer routes through the shared picture"
2061+ );
2062+
2063+ let picture = fn_body("picture_area");
2064+ assert!(
2065+ picture.contains(".children(self.preview_scrub_bar(cx))"),
2066+ "the shared Darkroom picture no longer mounts the preview scrub bar"
2067+ );
2068+
2069+ let preview = src_text("ui/preview.rs");
2070+ assert!(
2071+ preview.contains("this.preview_scrubbing = true")
2072+ && preview.contains("this.preview_scrub_to(event.position.x, true, cx)"),
2073+ "the mounted preview scrub no longer starts its drag-and-seek gesture"
2074+ );
2075+}