Files
HotSwapp 7958556613 Fix: Improved CSV encoding detection for legacy data with non-standard characters
- Changed encoding fallback order to prioritize iso-8859-1/latin-1 over cp1252
- Increased encoding test from 1KB to 10KB to catch issues deeper in files
- Added proper file handle cleanup on encoding failures
- Resolves 'charmap codec can't decode byte 0x9d' error in rolodex import
- Tested with rolodex file containing 52,100 rows successfully
2025-10-12 19:19:25 -05:00

28 lines
867 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${BASE_URL:-http://localhost:8000}"
echo "[1] Health check"
curl -sf "$BASE_URL/health" >/dev/null || { echo "Health check failed"; exit 1; }
echo "[2] API unauthenticated should return 401 JSON"
code=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/api/rolodex")
if [ "$code" != "401" ]; then
echo "Expected 401, got $code"
exit 1
fi
cat << 'EX'
Login via UI at /login to create a session cookie in your browser.
For scripted tests, copy the cookie to cookies.txt and run examples:
curl -b cookies.txt "$BASE_URL/api/rolodex?page=1&page_size=2&sort_by=last_name&sort_dir=asc"
curl -b cookies.txt "$BASE_URL/api/files?page=1&page_size=2&sort_by=open_date&sort_dir=desc"
curl -b cookies.txt "$BASE_URL/api/ledger?page=1&page_size=2&sort_by=transaction_date&sort_dir=desc"
EX
echo "Smoke tests completed."