test(workouts): separate pulse aggregates from curves

This commit is contained in:
Marc-André Bombeck committed 2026-07-29 14:57:42 +02:00
1 parent 43cce08012
commit 89fefce7ac
2 files changed
+37

No files matched your search

@@ -47,15 +47,27 @@ describe("<WorkoutList>", () => {
expect(html).toContain("320 kcal");
});
it("renders aggregate average HR without claiming an HR series", () => {
const html = render(
<WorkoutList workouts={[{ ...ROW, hasHrSeries: false }]} />,
);
expect(html).toContain('data-slot="workout-list-avg-hr"');
expect(html).toContain("145 bpm");
expect(html).not.toContain('data-slot="workout-list-glyph-hr"');
});
it("omits the chip when the field is null", () => {
const noDistance: WorkoutListEntry = {
...ROW,
distanceM: null,
activeEnergyKcal: null,
avgHr: null,
};
const html = render(<WorkoutList workouts={[noDistance]} />);
expect(html).not.toContain('data-slot="workout-list-distance"');
expect(html).not.toContain('data-slot="workout-list-energy"');
expect(html).not.toContain('data-slot="workout-list-avg-hr"');
});
it("falls back to the canonical sport string for unknown sport types", () => {