Spaces:
Sleeping
Sleeping
Download phd-advisor-frontend/src/components/SearchPathGate.test.js from BrainForge/HealthyEatingAdvisor: direct link, hf CLI and curl.
- Browser
- Download file 786 Bytes
-
https://huggingface.co/spaces/BrainForge/HealthyEatingAdvisor/resolve/main/phd-advisor-frontend/src/components/SearchPathGate.test.js
- Command line
-
hf download hf://spaces/BrainForge/HealthyEatingAdvisor/phd-advisor-frontend/src/components/SearchPathGate.test.js
-
curl -L -o SearchPathGate.test.js https://huggingface.co/spaces/BrainForge/HealthyEatingAdvisor/resolve/main/phd-advisor-frontend/src/components/SearchPathGate.test.js
786 Bytes
| import { needsSearchPath, persistFoodTrack, FOOD_TRACK, SEARCH_PATH_OPTIONS } from './SearchPathGate'; | |
| import { SEARCH_PATH_KEY, readScopedItem } from '../utils/canvasStorage'; | |
| beforeEach(() => { | |
| localStorage.clear(); | |
| }); | |
| test('food is the only track option', () => { | |
| expect(SEARCH_PATH_OPTIONS.map((o) => o.value)).toEqual([FOOD_TRACK]); | |
| }); | |
| test('the guest track popup never shows', () => { | |
| expect(needsSearchPath(null, 'guest-1')).toBe(false); | |
| expect(needsSearchPath({ cyber_role: 'Supplements' }, 'guest-1')).toBe(false); | |
| expect(needsSearchPath({ cyber_role: 'Healthcare' }, 'user-a')).toBe(false); | |
| }); | |
| test('persistFoodTrack stores Foods for the user', () => { | |
| persistFoodTrack('guest-1'); | |
| expect(readScopedItem(SEARCH_PATH_KEY, 'guest-1')).toBe(FOOD_TRACK); | |
| }); | |