update tests

This commit is contained in:
2026-01-22 18:53:42 -05:00
parent 2f27c1791b
commit 7c2e9b9abf
5 changed files with 138 additions and 120 deletions
-55
View File
@@ -1,55 +0,0 @@
#!/bin/bash
# Run all VHS e2e tests
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$REPO_ROOT"
echo "Running lazygitclj VHS e2e tests..."
echo "================================="
# List of test tapes (relative to repo root)
TESTS=(
"test/e2e/navigation.tape"
"test/e2e/cursor-navigation.tape"
"test/e2e/staging.tape"
"test/e2e/commit.tape"
"test/e2e/commit-verify.tape"
"test/e2e/branches.tape"
"test/e2e/branch-operations.tape"
"test/e2e/branches-tabs.tape"
"test/e2e/commits-tabs.tape"
"test/e2e/stash-operations.tape"
"test/e2e/stash-menu.tape"
"test/e2e/help-panel.tape"
"test/e2e/reset-menu.tape"
"test/e2e/undo-redo.tape"
)
PASSED=0
FAILED=0
for tape in "${TESTS[@]}"; do
echo ""
echo "Running: $tape"
echo "---"
if timeout 60 vhs "$tape" 2>&1; then
echo "PASSED: $tape"
((PASSED++))
else
echo "FAILED: $tape"
((FAILED++))
fi
done
echo ""
echo "================================="
echo "Results: $PASSED passed, $FAILED failed"
echo "================================="
if [ $FAILED -gt 0 ]; then
exit 1
fi
-26
View File
@@ -1,26 +0,0 @@
#!/bin/bash
# Setup test repo with many files for cursor navigation tests
REPO=/tmp/lazygitclj-e2e-cursor
rm -rf "$REPO"
mkdir -p "$REPO"
cd "$REPO"
git init -b main
git config user.email 'test@test.com'
git config user.name 'Test'
# Create 20 files
for i in $(seq 1 20); do
echo "content $i" > "file$i.txt"
done
git add .
git commit -m 'Initial'
# Modify all files to create unstaged changes
for i in $(seq 1 20); do
echo "modified $i" >> "file$i.txt"
done
echo "Cursor test repo created at $REPO"
-37
View File
@@ -1,37 +0,0 @@
#!/bin/bash
# Setup a test git repository for e2e tests
# Usage: ./setup-test-repo.sh /tmp/test-repo
REPO_DIR="${1:-/tmp/lazygitclj-e2e-test}"
# Remove existing repo if present
rm -rf "$REPO_DIR"
# Create and initialize repo
mkdir -p "$REPO_DIR"
cd "$REPO_DIR"
git init -b main
# Configure git
git config user.email "test@example.com"
git config user.name "Test User"
# Create initial files
echo "# Test Project" > README.md
echo "line1" > file1.txt
echo "line2" > file2.txt
git add .
git commit -m "Initial commit"
# Create feature branch with changes
git checkout -b feature-branch
echo "feature content" > feature.txt
git add .
git commit -m "Add feature"
# Go back to main and make some uncommitted changes
git checkout main
echo "modified" >> file1.txt
echo "new file" > new-file.txt
echo "Test repo created at $REPO_DIR"