From 2c3cad528a247c771bca136466337877f76f280f Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Thu, 12 Feb 2026 21:59:55 -0800 Subject: Implement Frontend Feed List with tests --- frontend/coverage/src/components/FeedList.tsx.html | 235 +++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 frontend/coverage/src/components/FeedList.tsx.html (limited to 'frontend/coverage/src/components/FeedList.tsx.html') diff --git a/frontend/coverage/src/components/FeedList.tsx.html b/frontend/coverage/src/components/FeedList.tsx.html new file mode 100644 index 0000000..d7344a2 --- /dev/null +++ b/frontend/coverage/src/components/FeedList.tsx.html @@ -0,0 +1,235 @@ + + + + + + Code coverage report for src/components/FeedList.tsx + + + + + + + + + +
+
+

All files / src/components FeedList.tsx

+
+ +
+ 94.44% + Statements + 17/18 +
+ + +
+ 83.33% + Branches + 10/12 +
+ + +
+ 100% + Functions + 6/6 +
+ + +
+ 93.75% + Lines + 15/16 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
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  +  +  +  +  +9x +9x +9x +  +9x +5x +  +3x +  +  +3x +  +  +3x +3x +  +  +1x +1x +  +  +  +9x +4x +  +3x +  +  +  +  +  +  +  +2x +  +  +  +  +  +  +  +  +  +  +  + 
import { useEffect, useState } from 'react';
+import type { Feed } from '../types';
+import './FeedList.css';
+ 
+export default function FeedList() {
+    const [feeds, setFeeds] = useState<Feed[]>([]);
+    const [loading, setLoading] = useState(true);
+    const [error, setError] = useState('');
+ 
+    useEffect(() => {
+        fetch('/api/feed/')
+            .then((res) => {
+                Iif (!res.ok) {
+                    throw new Error('Failed to fetch feeds');
+                }
+                return res.json();
+            })
+            .then((data) => {
+                setFeeds(data);
+                setLoading(false);
+            })
+            .catch((err) => {
+                setError(err.message);
+                setLoading(false);
+            });
+    }, []);
+ 
+    if (loading) return <div className="feed-list-loading">Loading feeds...</div>;
+    if (error) return <div className="feed-list-error">Error: {error}</div>;
+ 
+    return (
+        <div className="feed-list">
+            <h2>Feeds</h2>
+            {feeds.length === 0 ? (
+                <p>No feeds found.</p>
+            ) : (
+                <ul className="feed-list-items">
+                    {feeds.map((feed) => (
+                        <li key={feed._id} className="feed-item">
+                            <a href={feed.web_url} target="_blank" rel="noopener noreferrer" className="feed-title">
+                                {feed.title || feed.url}
+                            </a>
+                            {feed.category && <span className="feed-category">{feed.category}</span>}
+                        </li>
+                    ))}
+                </ul>
+            )}
+        </div>
+    );
+}
+ 
+ +
+
+ + + + + + + + \ No newline at end of file -- cgit v1.2.3