Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

test(config): the cardio-mode sheet test uses high knees, jumping jacks left cardio (#717)

Duarte Santosc12f10854110
diff --git a/frontend/src/sheets.config-cardio-mode.test.jsx b/frontend/src/sheets.config-cardio-mode.test.jsx
index 922f07847..d42ac04d6 100644
--- a/frontend/src/sheets.config-cardio-mode.test.jsx
+++ b/frontend/src/sheets.config-cardio-mode.test.jsx
@@ -1,7 +1,8 @@
// @vitest-environment happy-dom
-// A cardio exercise can be counted in sets x reps (#678): jumping jacks are filed under cardio in
+// A cardio exercise can be counted in sets x reps (#678): high knees are filed under cardio in
// the catalogue, which used to lock them to Intervals, Minutes and Speed. Their settings now offer
-// Cardio, Reps and Time, Cardio still the default.
+// Cardio, Reps and Time, Cardio still the default. (Jumping jacks were the example until #717 took
+// them out of cardio altogether.)
import React, { act } from 'react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { createRoot } from 'react-dom/client'
@@ -11,7 +12,7 @@ import { DEF, useStore } from './store/useStore.js'
import { useUI } from './store/useUI.js'
import { exConfigSheet } from './sheets.jsx'
-const JUMPING_JACK = '3094'
+const HIGH_KNEES = '3556'
const mounted = []
function open(ex, existing) {
useStore.setState({ S: structuredClone(DEF), user: null })
@@ -39,16 +40,16 @@ beforeEach(() => {
afterEach(() => { act(() => { mounted.splice(0).forEach(root => root.unmount()) }) })
describe('a cardio exercise logged as sets x reps (#678)', () => {
- it('jumping jack is cardio in the catalogue and opens on Cardio, with Reps and Time on offer', () => {
- expect(EXIDX[JUMPING_JACK].bp).toBe('cardio')
- const v = open(EXIDX[JUMPING_JACK], { sets: 1, min: 20, speed: 8 })
+ it('high knees are cardio in the catalogue and opens on Cardio, with Reps and Time on offer', () => {
+ expect(EXIDX[HIGH_KNEES].bp).toBe('cardio')
+ const v = open(EXIDX[HIGH_KNEES], { sets: 1, min: 20, speed: 8 })
expect(v.modes()).toEqual(['Cardio', 'Reps', 'Time'])
expect(v.picked()).toBe('Cardio')
expect(v.labels()).toContain('Intervals')
})
it('Reps gives it sets x reps, saved as a reps slot the session reads as reps', () => {
- const v = open(EXIDX[JUMPING_JACK], { sets: 1, min: 20, speed: 8 })
+ const v = open(EXIDX[HIGH_KNEES], { sets: 1, min: 20, speed: 8 })
v.pick('Reps')
expect(v.labels()).toEqual(expect.arrayContaining(['Sets', 'Reps']))
expect(v.labels()).not.toContain('Intervals')
@@ -57,18 +58,18 @@ describe('a cardio exercise logged as sets x reps (#678)', () => {
// Three sets, not the one interval it came from.
expect(saved).toMatchObject({ mode: 'reps', sets: 3, reps: 10 })
expect(saved).not.toHaveProperty('min')
- expect(modeOf({ ...saved, id: JUMPING_JACK })).toBe('reps')
+ expect(modeOf({ ...saved, id: HIGH_KNEES })).toBe('reps')
})
it('reopens on Reps, and going back to Cardio saves an interval again', () => {
- const v = open(EXIDX[JUMPING_JACK], { sets: 3, reps: 20, weight: 0, mode: 'reps', bodyweight: true })
+ const v = open(EXIDX[HIGH_KNEES], { sets: 3, reps: 20, weight: 0, mode: 'reps', bodyweight: true })
expect(v.picked()).toBe('Reps')
v.pick('Cardio')
expect(v.labels()).toContain('Intervals')
v.save()
const saved = v.onSave.mock.calls[0][0]
expect(saved).toMatchObject({ sets: 1, min: 20, speed: 8 })
- expect(modeOf({ ...saved, id: JUMPING_JACK })).toBe('cardio')
+ expect(modeOf({ ...saved, id: HIGH_KNEES })).toBe('cardio')
})
it('a strength exercise still only offers Reps and Time', () => {