-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-dark-mode.sh
More file actions
executable file
Β·51 lines (45 loc) Β· 1.5 KB
/
test-dark-mode.sh
File metadata and controls
executable file
Β·51 lines (45 loc) Β· 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Test: Dark Mode Functionality Validation
# Quick verification that dark mode works locally
echo "π Dark Mode Test Result"
echo "======================="
# Test 1: Server responds
if curl -s http://127.0.0.1:4000 > /dev/null; then
echo "β
Jekyll server running at http://127.0.0.1:4000"
else
echo "β Jekyll server not running"
echo "π§ Run: cd /Users/yebyen/u/c/cozystack-moon-and-back && ./serve-local.sh"
exit 1
fi
# Test 2: Dark mode toggle present
if curl -s http://127.0.0.1:4000 | grep -q "theme-toggle"; then
echo "β
Dark mode toggle button found"
else
echo "β Dark mode toggle missing"
exit 1
fi
# Test 3: JavaScript functionality present
if curl -s http://127.0.0.1:4000 | grep -q "localStorage.setItem.*theme"; then
echo "β
Dark mode JavaScript functional"
else
echo "β Dark mode JavaScript missing"
exit 1
fi
# Test 4: CSS variables present
if curl -s http://127.0.0.1:4000/assets/css/style.css | grep -q "data-theme.*dark"; then
echo "β
Dark mode CSS variables implemented"
else
echo "β Dark mode CSS missing"
exit 1
fi
echo ""
echo "π― MANUAL TEST REQUIRED:"
echo "========================"
echo "1. π Open: http://127.0.0.1:4000"
echo "2. π Click dark mode toggle (top-right corner)"
echo "3. β¨ Verify background turns dark (#0d1117)"
echo "4. π Refresh page - preference should persist"
echo "5. βοΈ Toggle back to light mode"
echo ""
echo "β
All automated checks passed!"
echo "π Ready for manual validation"