# VHS E2E test for lazygitclj - Commit workflow
# Tests committing staged files (like lazygit's c key)

Output test/e2e/output/commit.gif
Output test/e2e/output/commit.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-commit && cd /tmp/lazygitclj-e2e-commit && bb --config /home/ajet/repos/lazygitclj/bb.edn start"
Enter
Sleep 2s

# Stage all files first
Type "a"
Sleep 500ms

# Press 'c' to start commit (like lazygit)
Type "c"
Sleep 500ms

# Type commit message (with typing speed set)
Set TypingSpeed 50ms
Type "Add test changes"
Sleep 500ms

# Press Enter to commit
Enter
Sleep 1s

# Should see "Committed!" message and files should be cleared
# Check commits panel to verify
Type "2"
Sleep 500ms

# Navigate commits to see new commit
Type "j"
Sleep 500ms
Type "k"
Sleep 500ms

# Quit
Type "q"
Sleep 1s
