feat(auth): implement all 16 homepage/login/register review items
- add countArticles() (published-only, mirrors news-list) and warm total_articles - localize homepage metadata; bind articleCount to both stats; unique photo alts - drop duplicate news date and the mascot preload priorities - extract shared AuthPageFrame/AuthUsersCards used by /login and /register - login: localized noindex metadata, session redirect via safeRedirectPath, ?from passthrough from proxy, unified auth roster cache keys, registered notice - register: localized metadata, session redirect to /me, unified cache keys - add resend-verification flow on /verify with rate-limited non-enumerable action - add safeRedirectPath() with unit tests - register form: live requirements checklist + password mismatch guard - login form: unverified state with resend-link CTA - honour prefers-reduced-motion in TypewriterText - add 6 translations across all 25 locales
This commit is contained in:
1 parent
8561c3f85e
commit
3933214953
43 files changed
+1037
-490
No files matched your search
@@ -14,6 +14,7 @@ const tables = vi.hoisted(() => ({
|
||||
User: { name: "users" },
|
||||
Rooms: { name: "rooms" },
|
||||
CameraWeb: { name: "camera_web" },
|
||||
WebsiteArticles: { name: "website_articles" },
|
||||
}));
|
||||
|
||||
vi.mock("@/lib/db", () => {
|
||||
@@ -48,6 +49,7 @@ vi.mock("@/lib/db", () => {
|
||||
});
|
||||
|
||||
import {
|
||||
countArticles,
|
||||
countOnline,
|
||||
countPhotos,
|
||||
countRooms,
|
||||
@@ -98,3 +100,11 @@ it("keeps the online count exact", async () => {
|
||||
state.exact = 12;
|
||||
expect(await countOnline()).toBe(12);
|
||||
});
|
||||
|
||||
it("counts the articles table, not the news preview it renders from", async () => {
|
||||
// The homepage shows a total article count while the news panel beside it
|
||||
// only ever receives the four latest rows — the two must not be conflated.
|
||||
state.perTable = { website_articles: 42, users: 7 };
|
||||
expect(await countArticles()).toBe(42);
|
||||
expect(await countUsers()).toBe(7);
|
||||
});
|
||||
Reference in new issue
Block a user