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.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Test aliases through library and exercise picker searches
Space-Hermes8e9d61d92bd6
diff --git a/frontend/src/search-count.test.jsx b/frontend/src/search-count.test.jsxindex d52b66222..5aa371cca 100644--- a/frontend/src/search-count.test.jsx+++ b/frontend/src/search-count.test.jsx@@ -10,6 +10,7 @@ import { DEF, useStore } from './store/useStore.js'import { useUI } from './store/useUI.js'import { exercisePicker } from './sheets.jsx'import Library from './views/Library.jsx'+import { registerExerciseAliases } from './lib/exercise-aliases.js'import { EXDB, searchExercises } from './lib/exercises.js'globalThis.IS_REACT_ACT_ENVIRONMENT = true@@ -36,6 +37,7 @@ const count = host => host.querySelector('.search .search-count')beforeEach(() => {useUI.setState({ sheets: [], toastMsg: '' })useStore.setState({ S: structuredClone(DEF), user: null })+ registerExerciseAliases({})document.body.innerHTML = ''})afterEach(() => { act(() => { mounted.splice(0).forEach(root => root.unmount()) }) })@@ -48,6 +50,37 @@ describe('exercise search result count', () => {['Library', () => mount(<MemoryRouter><Library /></MemoryRouter>)],['exercise picker', () => { exercisePicker(vi.fn()); return renderTopSheet() }],]) {+ it(`${where}: finds aliases, follows edits and clears, and keeps filters`, () => {+ const host = open()+ const input = host.querySelector('.search input')+ const update = fn => act(() => useStore.getState().update(fn))+ update(s => {+ s.exAliases = { '1162': ['Zentara lift'] }+ s.customEx = [{ id: 'calias', n: 'Custom shoulder press', bp: 'shoulders', eq: 'barbell', custom: true, aliases: ['Harbour lift'] }]+ })+ for (const query of ['Zentara lift', 'ZENTARA LIFT', 'zentara', 'lift zentara', 'zentara barbell']) {+ act(() => type(input, query))+ expect(count(host).textContent).toBe('1')+ expect(host.textContent.toLowerCase()).toContain('barbell standing military press')+ }+ act(() => type(input, 'Harbour lift'))+ expect(count(host).textContent).toBe('1')+ expect(host.textContent).toContain('Custom shoulder press')+ act(() => type(input, 'Zentara lift'))+ act(() => chip(host, 'neck').click())+ expect(count(host).textContent).toBe('0')+ act(() => chip(host, 'All').click())+ expect(count(host).textContent).toBe('1')+ update(s => { s.exAliases['1162'] = ['Summit lift'] })+ expect(count(host).textContent).toBe('0')+ act(() => type(input, 'Summit lift'))+ expect(count(host).textContent).toBe('1')+ update(s => { s.exAliases['1162'] = [] })+ expect(count(host).textContent).toBe('0')+ act(() => type(input, 'barbell standing military press'))+ expect(Number(count(host).textContent)).toBeGreaterThan(0)+ })+it(`${where}: appears with a search, follows it, and goes when the search is cleared`, () => {const host = open()const input = host.querySelector('.search input')