fix(tests): repair hero-strip and telegram-test-locale assertions after R3a

Two test-contract fixes for fallout from concurrent R3a contributors:

- hero-strip.test.tsx — collapses the two onAskCoach forwarding tests
  into a single regression guard that asserts the inline Health Score
  card Ask-the-Coach button stays retired and the hero strip's
  action-row button carries the affordance.

- telegram-test-locale.test.ts — the route's POST handler takes zero
  arguments (apiHandler wraps an async () => function). Drops the
  Request argument from all seven call sites.
This commit is contained in:
Marc-André Bombeck committed 2026-05-15 17:00:13 +02:00
1 parent f3ff262451
commit 5886fea8d7
2 files changed
+14 -32

No files matched your search

@@ -306,7 +306,12 @@ describe("<HeroStrip>", () => {
expect(html).toContain(">86<");
});
it("forwards onAskCoach into the Health Score panel only when both are supplied", () => {
it("does not render an inline Ask-the-Coach button inside the Health Score card", () => {
// v1.4.27 F8 — the inline HSC Ask-the-Coach button retired in
// favour of the hero strip's existing action-row button. Even
// when `onAskCoach` is supplied, the HSC panel must not surface
// its own button. The action-row button at
// `insights-hero-strip-action-coach` carries the affordance.
const html = render(
<HeroStrip
briefing={null}
@@ -325,31 +330,8 @@ describe("<HeroStrip>", () => {
onAskCoach={() => {}}
/>,
);
// HSC panel renders its own Ask-the-Coach button with the score-
// aware label (the action-row button uses the shorter "Ask the
// coach" copy). The HSC button mirrors the panel's slot.
expect(html).toMatch(/data-slot="health-score-card-ask-coach"/);
});
it("hides the Health Score panel's Ask button when no onAskCoach is supplied", () => {
const html = render(
<HeroStrip
briefing={null}
now={morningLocal}
healthScore={{
score: 86,
band: "green",
components: {
bp: { value: 80, weight: 0.3 },
weight: { value: 70, weight: 0.2 },
mood: { value: 90, weight: 0.2 },
compliance: { value: 100, weight: 0.3 },
},
delta: 5,
}}
/>,
);
expect(html).not.toContain('data-slot="health-score-card-ask-coach"');
expect(html).toContain('data-slot="insights-hero-strip-action-coach"');
});
it("uses the lg row layout when healthScore is supplied (smoke test on container class)", () => {