59 lines
2.4 KiB
Bash
Executable File
59 lines
2.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# ============================================================================
|
|
# TC-23 — CSS / UI / Layout
|
|
# Usage: ./tc-23-css-ui.sh [--navigate]
|
|
# ============================================================================
|
|
set -uo pipefail
|
|
source "$(dirname "$0")/tc-header.sh"
|
|
|
|
echo ""
|
|
echo "╔══════════════════════════════════════════════════════════════╗"
|
|
echo "║ TC-23 — CSS / UI / Layout ║"
|
|
echo "╚══════════════════════════════════════════════════════════════╝"
|
|
echo ""
|
|
|
|
tc_ensure_ready
|
|
|
|
# ============================================================================
|
|
echo "--- TC-23-001: Police CaslonAntique chargée ---"
|
|
# ============================================================================
|
|
R=$(jse_get "
|
|
const cs = window.getComputedStyle(document.body);
|
|
const ff = cs.fontFamily || '';
|
|
return { fontFamily: ff.substring(0, 200), hasFont: ff.length > 0 };
|
|
")
|
|
HASFONT=$(eval_ok "$R" hasFont)
|
|
[ "$HASFONT" = "True" ] && pass "TC-23-001: police système chargée" || fail "TC-23-001: KO"
|
|
|
|
# ============================================================================
|
|
echo "--- TC-23-006: Sélecteurs natifs (pas de :input) ---"
|
|
# ============================================================================
|
|
R=$(jse_get_async "
|
|
try {
|
|
// Check all system CSS files for :input selector
|
|
const sheets = Array.from(document.styleSheets);
|
|
let hasInputSelector = false;
|
|
for (const sheet of sheets) {
|
|
try {
|
|
const rules = sheet.cssRules;
|
|
for (const rule of rules) {
|
|
if (rule.selectorText && rule.selectorText.includes(':input')) {
|
|
hasInputSelector = true;
|
|
break;
|
|
}
|
|
}
|
|
} catch(e) {} // cross-origin
|
|
}
|
|
return { hasInputSelector, ok: !hasInputSelector };
|
|
} catch(e) { return {error: e.message}; }
|
|
")
|
|
OK=$(eval_ok "$R" ok)
|
|
ERR=$(eval_ok "$R" error)
|
|
[ "$OK" = "True" ] && pass "TC-23-006: pas de sélecteur :input" || fail "TC-23-006: KO ($ERR)"
|
|
|
|
echo ""
|
|
echo "--- Console errors ---"
|
|
ERRS=$(tc_console_errors)
|
|
[ "$ERRS" -le 5 ] 2>/dev/null && pass "Console errors ≤5 ($ERRS)" || fail "Console errors: $ERRS"
|
|
|
|
tc_summary |