# VHS E2E test for lazygitclj - Navigation and panel switching
# Tests h/l panel navigation, number keys, and cursor movement

Output test/e2e/output/navigation.gif
Output test/e2e/output/navigation.ascii

Require bb

Set Shell "bash"
Set FontSize 14
Set Width 1000
Set Height 600
Set Framerate 10

# Setup test repo and run lazygitclj
Type "./test/e2e/setup-test-repo.sh /tmp/lazygitclj-e2e-nav && cd /tmp/lazygitclj-e2e-nav && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
Enter
Sleep 2s

# Should start on Files panel (panel 2)
# Navigate down with j (vim style)
Type "j"
Sleep 500ms
Type "j"
Sleep 500ms

# Navigate up with k
Type "k"
Sleep 500ms

# Switch to Branches panel with l
Type "l"
Sleep 500ms

# Navigate branches
Type "j"
Sleep 500ms

# Switch to Commits panel with l
Type "l"
Sleep 500ms

# Switch to Stash panel with l
Type "l"
Sleep 500ms

# Go back to Files with h
Type "h"
Sleep 300ms
Type "h"
Sleep 300ms
Type "h"
Sleep 500ms

# Switch to Branches using number key (3)
Type "3"
Sleep 500ms

# Switch to Commits using number key (4)
Type "4"
Sleep 500ms

# Switch to Stash using number key (5)
Type "5"
Sleep 500ms

# Go back to Files (2)
Type "2"
Sleep 500ms

# Test arrow keys
Down
Sleep 300ms
Up
Sleep 300ms

# Quit with q
Type "q"
Sleep 1s
