# VHS E2E test for lazygitclj - Stash operations
# Tests stash push, apply, pop, drop

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

# Should see modified files in Files panel
# Stash all changes with 's'
Type "s"
Sleep 1s

# Working tree should now be clean
# Switch to stash panel (5)
Type "5"
Sleep 500ms

# Should see 1 stash entry
# Apply stash with space
Type " "
Sleep 1s

# Pop stash with g (should remove it)
Type "g"
Sleep 1s

# Create another stash by going back to files
Type "2"
Sleep 500ms

# Make changes visible, stash again
Type "r"
Sleep 500ms
Type "s"
Sleep 1s

# Go to stash panel and drop
Type "5"
Sleep 500ms
Type "d"
Sleep 1s

# Stash should be dropped

# Quit
Type "q"
Sleep 1s
