···6262 updateTag: vi.fn(),
6363 cacheTag: vi.fn(),
6464 cacheLife: vi.fn(),
6565+ refresh: vi.fn(),
6566}));
66676768// Mock next/headers (no cookies in tests)
+5-4
data/__tests__/trails.test.ts
···665665 createdAt: sixtyDaysAgo,
666666 });
667667668668- // Create a brand new trail with no activity
668668+ // Create another trail outside grace period but with no activity
669669+ const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
669670 await emit("app.sidetrail.trail", BOB.did, {
670671 $type: "app.sidetrail.trail",
671672 title: "New Trail No Activity",
672672- description: "Brand new but no one has walked",
673673+ description: "Outside grace period but no one has walked",
673674 stops: [{ tid: generateTid(), title: "Stop", content: "Content" }],
674675 accentColor: "#222",
675676 backgroundColor: "#ddd",
676676- createdAt: now(),
677677+ createdAt: oneDayAgo,
677678 });
678679679680 // Add activity to the old trail
···687688688689 const trails = await queries.loadTrails();
689690690690- // Old trail with activity ranks first (tier 0), new trail without activity second (tier 1)
691691+ // Both trails are tier 2 (outside grace period, < 5 activity), but trail with activity ranks higher
691692 expect(trails).toHaveLength(2);
692693 expect(trails[0].title).toBe("Old Trail With Activity");
693694 expect(trails[1].title).toBe("New Trail No Activity");