diff --git a/src/components/insights/__tests__/daily-briefing.test.tsx b/src/components/insights/__tests__/daily-briefing.test.tsx index e60171a71..5aeeb58e8 100644 --- a/src/components/insights/__tests__/daily-briefing.test.tsx +++ b/src/components/insights/__tests__/daily-briefing.test.tsx @@ -63,10 +63,15 @@ describe("", () => { expect(html).toContain("Tagesbriefing"); }); - it("renders the narrative paragraph", () => { + it("v1.4.27 B1 — does NOT render the leading narrative paragraph", () => { + // The hero strip subtitle on /insights renders the same + // `briefing.paragraph` directly above this card, so the card now + // opens straight on the key-findings list. The paragraph slot is + // gone from the populated branch; the empty-state branch still + // owns its CTA copy. const html = render(); - expect(html).toMatch(/data-slot="daily-briefing-paragraph"/); - expect(html).toContain( + expect(html).not.toContain('data-slot="daily-briefing-paragraph"'); + expect(html).not.toContain( "Blood pressure is in target band on 9 of 10 readings", ); }); @@ -133,13 +138,16 @@ describe("", () => { }); it("hides the keyFindings section when the array is empty", () => { + // v1.4.27 B1 — the leading paragraph dropped; the card now renders + // only the header + (when present) the findings list. With both + // gone the populated branch produces no body content, which the + // hero strip already covers. const html = render( , ); expect(html).not.toContain('data-slot="daily-briefing-findings-title"'); expect(html).not.toContain('data-slot="daily-briefing-findings"'); - // Paragraph still renders. - expect(html).toContain("trending well this week"); + expect(html).not.toContain('data-slot="daily-briefing-paragraph"'); }); it("renders the empty state when briefing is null and not loading", () => { diff --git a/src/components/insights/__tests__/health-score-card.test.tsx b/src/components/insights/__tests__/health-score-card.test.tsx index 9d7d3ee3c..6b7e2f12f 100644 --- a/src/components/insights/__tests__/health-score-card.test.tsx +++ b/src/components/insights/__tests__/health-score-card.test.tsx @@ -179,8 +179,12 @@ describe("", () => { expect(html).toContain("Indicative"); }); - it("does NOT render the Ask-the-Coach button when onAskCoach is omitted", () => { - const html = ssr( + it("v1.4.27 B1 — no longer mounts an inline Ask-the-Coach button (hero strip carries the CTA)", () => { + // The hero strip's existing "Ask the coach" action covers this + // surface; the card-internal duplicate button retired. The + // onAskCoach prop stays on the type signature so callers don't + // break, but the card no longer renders it. + const omitted = ssr( ", () => { delta={null} />, ); - expect(html).not.toContain('data-slot="health-score-card-ask-coach"'); - }); - - it("renders the Ask-the-Coach button when onAskCoach is supplied", () => { - const html = ssr( + const supplied = ssr( ", () => { onAskCoach={() => {}} />, ); - expect(html).toMatch(/data-slot="health-score-card-ask-coach"/); - expect(html).toContain("Ask the Coach"); + expect(omitted).not.toContain('data-slot="health-score-card-ask-coach"'); + expect(supplied).not.toContain('data-slot="health-score-card-ask-coach"'); }); it("captures the score-aware prefill argument when the button is invoked", () => { @@ -244,9 +244,11 @@ describe("", () => { "de", ); expect(html).toContain("Gesundheitsscore"); - expect(html).toContain("Coach fragen"); expect(html).toContain("im Vergleich zur Vorwoche"); expect(html).toContain("Orientierungshilfe"); + // v1.4.27 B1 — the inline Coach button retired; hero strip carries + // the action now. + expect(html).not.toContain("Coach fragen"); }); it("uses tabular-nums on the headline number for stable layout", () => { diff --git a/src/components/insights/daily-briefing.tsx b/src/components/insights/daily-briefing.tsx index 1b38a860c..d01782af8 100644 --- a/src/components/insights/daily-briefing.tsx +++ b/src/components/insights/daily-briefing.tsx @@ -232,12 +232,13 @@ export function DailyBriefing({ ) : briefing ? (
-

- {stripChartTokens(briefing.paragraph)} -

+ {/* v1.4.27 B1 — the leading narrative paragraph dropped. + The hero strip subtitle on `/insights` already renders + the same `briefing.paragraph` text directly above this + card, so the user used to read the same string twice + within 200 px. The card now opens straight on the + structured key-findings list, which is the part the + hero subtitle cannot surface. */} {briefing.keyFindings.length > 0 && (

@@ -277,7 +277,11 @@ export function HealthScoreCard({ @@ -293,7 +297,7 @@ export function HealthScoreCard({
+ {/* v1.4.27 B1 — disclaimer bumped from text-[10px] to + text-[11px] (BL-P4-9 L2: the 10 px size was borderline + against the 12 px mobile floor). The hero strip already + carries an "Ask the coach" action so the inline button + here retires; the parent still receives onAskCoach via + other surfaces but the card no longer mounts a duplicate + CTA. */}

{t("insights.healthScore.disclaimer")}

- - {onAskCoach && ( - - )}
);