test(reconcile): align cross-branch fixture drift in v1.4.48 integration

- analytics/route.test.ts slim-summaries fixture: mock 4 $queryRaw
  calls (coverage + allTime + windowed + latest) to match the M0
  cold-fallback split shape
- dashboard-layout-section hint assertion: anchor on the new L9
  shortened German copy ("Pfeiltasten Hoch/Runter") instead of the
  pre-v1.4.48 phrase
This commit is contained in:
Marc-André Bombeck committed 2026-05-23 10:32:39 +02:00
1 parent 78f91d7876
commit c8b6eb761b
2 files changed
+15 -6

No files matched your search

+11 -4
View File
@@ -305,10 +305,12 @@ describe("GET /api/analytics", () => {
// contract the dashboard tile strip reads.
it("returns the slim summaries slice when ?slice=summaries is set", async () => {
const fiveDaysAgo = new Date(Date.now() - 5 * 24 * 60 * 60 * 1000);
// v1.4.36 — slim slice now opens with a cheap `SELECT COUNT(*) FROM
// measurement_rollups` probe. Force `n: 0` so the route takes the
// legacy heavy-aggregate fallback path that this test's fixtures
// expect (aggregate + latest, two `$queryRaw` passes).
// v1.4.36 — slim slice opens with a cheap `SELECT COUNT(*) FROM
// measurement_rollups` probe; `n: 0` forces the cold-fallback
// path. v1.4.48 M0 split that path's single aggregate query into
// two parallel ones (all-time + windowed), so the cold fixture
// now mocks 4 `$queryRaw` calls: coverage + allTime + windowed +
// latest.
vi.mocked(prisma.$queryRaw)
.mockResolvedValueOnce([{ n: BigInt(0) }] as never)
.mockResolvedValueOnce([
@@ -318,6 +320,11 @@ describe("GET /api/analytics", () => {
min_value: 80.0,
max_value: 84.5,
mean_value: 82.1,
},
] as never)
.mockResolvedValueOnce([
{
type: "WEIGHT",
avg7: 82.0,
avg30: 82.2,
slope7: -0.05,
@@ -130,8 +130,10 @@ describe("<DashboardLayoutSection> — drag-and-drop reorder", () => {
it("hint string localises to German", () => {
const html = render(<DashboardLayoutSection id="dashboard-layout" />, "de");
// Anchor on a stable German fragment from the hint copy.
expect(html).toContain("Ziehe den Griff");
// v1.4.48 L9 — copy trimmed to ~12 words so screen readers do
// not spend ~6 s reading the hint on focus. Anchor on the
// shortened phrase.
expect(html).toContain("Pfeiltasten Hoch/Runter");
});
});