summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-07-25 22:11:15 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-07-25 22:11:15 +0900
commitf83491274f88355057693c96a5e9355b38451ac0 (patch)
treeff75c303bb853668b1065b39cee17e9cb1d9a03c /test
parentc0435fdff469de6046c693ad283f927428fd4910 (diff)
Add toggle-header option
Close #3358
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 534cbba5..f85f7a23 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -1213,6 +1213,39 @@ class TestGoFZF < TestBase
end
end
+ def test_toggle_header
+ tmux.send_keys "seq 4 | #{FZF} --header-lines 2 --header foo --bind space:toggle-header --header-first --height 10 --border", :Enter
+ before = <<~OUTPUT
+ ╭───────
+ │
+ │ 4
+ │ > 3
+ │ 2/2
+ │ >
+ │ 2
+ │ 1
+ │ foo
+ ╰───────
+ OUTPUT
+ tmux.until { assert_block(before, _1) }
+ tmux.send_keys :Space
+ after = <<~OUTPUT
+ ╭───────
+ │
+ │
+ │
+ │
+ │ 4
+ │ > 3
+ │ 2/2
+ │ >
+ ╰───────
+ OUTPUT
+ tmux.until { assert_block(after, _1) }
+ tmux.send_keys :Space
+ tmux.until { assert_block(before, _1) }
+ end
+
def test_cancel
tmux.send_keys "seq 10 | #{fzf('--bind 2:cancel')}", :Enter
tmux.until { |lines| assert_equal ' 10/10', lines[-2] }