From a4997a5fbc65913b55f2215eb3b868693bd76c51 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 14 Feb 2026 10:03:35 -0800 Subject: test: increase frontend coverage for Settings and improve FeedItem css --- frontend/coverage/src/components/Login.tsx.html | 225 ++++++++++++------------ 1 file changed, 117 insertions(+), 108 deletions(-) (limited to 'frontend/coverage/src/components/Login.tsx.html') diff --git a/frontend/coverage/src/components/Login.tsx.html b/frontend/coverage/src/components/Login.tsx.html index f29e3cb..43fb613 100644 --- a/frontend/coverage/src/components/Login.tsx.html +++ b/frontend/coverage/src/components/Login.tsx.html @@ -1,64 +1,68 @@ + - + + Code coverage report for src/components/Login.tsx - - - - -
-
-

- All files / - src/components Login.tsx -

-
-
- 100% - Statements - 17/17 -
- -
- 83.33% - Branches - 5/6 -
- -
- 100% - Functions - 3/3 -
- -
- 100% - Lines - 17/17 -
+ + + +
+
+

All files / src/components Login.tsx

+
+ +
+ 100% + Statements + 17/17 +
+ + +
+ 83.33% + Branches + 5/6 +
+ + +
+ 100% + Functions + 3/3 +
+ + +
+ 100% + Lines + 17/17 +
+ +

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

-
-
-

+    
+    
+
1 2 3 @@ -113,7 +117,11 @@ 52 53 54 -55  +55 +56 +57  +  +        @@ -171,74 +179,75 @@ import { useNavigate } from 'react-router-dom'; import './Login.css';   +import { apiFetch } from '../utils'; +  export default function Login() { - const [password, setPassword] = useState(''); - const [error, setError] = useState(''); - const navigate = useNavigate(); + const [password, setPassword] = useState(''); + const [error, setError] = useState(''); + const navigate = useNavigate();   - const handleSubmit = async (e: FormEvent) => { - e.preventDefault(); - setError(''); + const handleSubmit = async (e: FormEvent) => { + e.preventDefault(); + setError('');   - try { - // Use URLSearchParams to send as form-urlencoded, matching backend expectation - const params = new URLSearchParams(); - params.append('password', password); + try { + // Use URLSearchParams to send as form-urlencoded, matching backend expectation + const params = new URLSearchParams(); + params.append('password', password);   - const res = await fetch('/api/login', { - method: 'POST', - body: params, - }); + const res = await apiFetch('/api/login', { + method: 'POST', + body: params, + });   - if (res.ok) { - navigate('/'); - } else { - const data = await res.json(); - setError(data.message || 'Login failed'); - } - } catch (err) { - setError('Network error'); - } - }; + if (res.ok) { + navigate('/'); + } else { + const data = await res.json(); + setError(data.message || 'Login failed'); + } + } catch (err) { + setError('Network error'); + } + };   - return ( - <div className="login-container"> - <form onSubmit={handleSubmit} className="login-form"> - <h1>neko rss mode</h1> - <div className="form-group"> - <label htmlFor="password">password</label> - <input - id="password" - type="password" - value={password} - onChange={(e) => setPassword(e.target.value)} - autoFocus - /> - </div> - {error && <div className="error-message">{error}</div>} - <button type="submit">login</button> - </form> + return ( + <div className="login-container"> + <form onSubmit={handleSubmit} className="login-form"> + <h1>neko rss mode</h1> + <div className="form-group"> + <label htmlFor="password">password</label> + <input + id="password" + type="password" + value={password} + onChange={(e) => setPassword(e.target.value)} + autoFocus + /> </div> - ); + {error && <div className="error-message">{error}</div>} + <button type="submit">login</button> + </form> + </div> + ); }  
-
- -
- - - - - - - +
+
+ + + + + + + \ No newline at end of file -- cgit v1.2.3