/* Home screen — topic catalog */ function HomeScreen({ onOpenTopic, user, onLogout }) { const [q, setQ] = useState(""); const topics = window.TOPICS; const totalMins = window.TOPICS_TOTAL_MINUTES; const fmt = window.formatMinutes; const filtered = useMemo(() => { const needle = q.trim().toLowerCase(); if (!needle) return topics; return topics.filter((t) => t.title.toLowerCase().includes(needle) || t.description.toLowerCase().includes(needle) || t.tags.some((tag) => tag.includes(needle)) ); }, [q, topics]); const filteredMins = useMemo( () => filtered.reduce((s, t) => s + (t.estMinutes || 0), 0), [filtered] ); return (
Each assignment isolates one common UI automation challenge. Read the scenario, write your automated test against the playground component, and verify your assertion passes.