mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
test(dashboard-hero): cover hero-ring-order default + reorder; i18n hint
Add resolveHeroRingOrder unit coverage (default health-score-first, reconcile against selected set, drop/append, dedupe) plus resolver/serializer round-trip; hero SSR tests for the default lead + a persisted custom order + dropped-when-unrendered; Settings picker tests for the pinned health-score anchor row, its locked-on switch, drag/arrow reorder, and a persisted non-leading order. Extend the score-rings picker description across six locales.
This commit is contained in:
1 parent
abe688caba
commit
abb2db37ee
13 files changed
+317
-26
No files matched your search
@@ -139,7 +139,10 @@ const layoutSchema = z.object({
|
||||
// resolver reconciles it against the selected set on read/serialize, so a
|
||||
// stale or over-long array is clamped rather than rejected. `.max()`
|
||||
// bounds the wire length (health-score + up to three score rings).
|
||||
heroRingOrder: z.array(z.enum(HERO_RING_IDS)).max(MAX_HERO_RING_ORDER).optional(),
|
||||
heroRingOrder: z
|
||||
.array(z.enum(HERO_RING_IDS))
|
||||
.max(MAX_HERO_RING_ORDER)
|
||||
.optional(),
|
||||
});
|
||||
|
||||
async function buildDashboardLayout(userId: string): Promise<DashboardLayout> {
|
||||
@@ -290,8 +293,7 @@ export const PUT = apiHandler(async (request: NextRequest) => {
|
||||
let mergedHeroVisible: boolean | undefined = parsed.data.heroVisible;
|
||||
let mergedScoreRings: ScoreRingId[] | undefined =
|
||||
parsed.data.selectedScoreRings;
|
||||
let mergedHeroRingOrder: HeroRingId[] | undefined =
|
||||
parsed.data.heroRingOrder;
|
||||
let mergedHeroRingOrder: HeroRingId[] | undefined = parsed.data.heroRingOrder;
|
||||
if (
|
||||
mergedChartOverlayPrefs === undefined ||
|
||||
mergedHeroVisible === undefined ||
|
||||
|
||||
Reference in new issue
Block a user