File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -512,6 +512,37 @@ def test_resize(
512
512
assert window_height_before < window_height_expanded
513
513
514
514
515
+ @pytest .mark .skipif (
516
+ has_lt_version ("3.2" ),
517
+ reason = "Only 3.2+ has the -a and -b flag on new-window" ,
518
+ )
519
+ def test_new_window_with_direction (
520
+ session : Session ,
521
+ ) -> None :
522
+ """Verify new window with direction."""
523
+ window = session .active_window
524
+ window .refresh ()
525
+
526
+ window_initial = session .new_window (window_name = "Example" )
527
+ assert window_initial .window_index == "2"
528
+
529
+ window_before = session .new_window (
530
+ window_name = "Window before" , direction = NewWindowDirection .Before
531
+ )
532
+ window_initial .refresh ()
533
+ assert window_before .window_index == "1"
534
+ assert window_initial .window_index == "3"
535
+
536
+ window_after = session .new_window (
537
+ window_name = "Window after" , direction = NewWindowDirection .Before
538
+ )
539
+ window_initial .refresh ()
540
+ window_after .refresh ()
541
+ assert window_after .window_index == "2"
542
+ assert window_initial .window_index == "4"
543
+ assert window_before .window_index == "1"
544
+
545
+
515
546
@pytest .mark .skipif (
516
547
has_gte_version ("3.1" ),
517
548
reason = "Only 3.1 has the -a and -b flag on new-window" ,
You can’t perform that action at this time.
0 commit comments