Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download web_app/src/lib/batchJobFullRunPhase.test.ts from CommunityOne/open-navigator: direct link, hf CLI and curl.
- Browser
- Download file 1.87 kB
-
https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/lib/batchJobFullRunPhase.test.ts
- Command line
-
hf download hf://spaces/CommunityOne/open-navigator/web_app/src/lib/batchJobFullRunPhase.test.ts
-
curl -L -o batchJobFullRunPhase.test.ts https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/lib/batchJobFullRunPhase.test.ts
1.87 kB
| import { describe, expect, it } from 'vitest' | |
| import { | |
| fullRunPhaseFromLog, | |
| fullRunPhaseLabel, | |
| stageOwnsFullRunLog, | |
| } from './batchJobFullRunPhase' | |
| describe('fullRunPhaseFromLog', () => { | |
| it('defaults Run all to Discover before any banner', () => { | |
| expect(fullRunPhaseFromLog([], '', { step: 'all' })).toBe('discover') | |
| }) | |
| it('defaults Run each to Videos (no Discover)', () => { | |
| expect(fullRunPhaseFromLog([], '', { step: 'each' })).toBe('videos') | |
| }) | |
| it('stays on Discover while channel candidates run', () => { | |
| const lines = [ | |
| '=== Discover (channel candidates) ===', | |
| 'Discovering YouTube channels for Coffee, AL', | |
| 'Testing 13 common handle patterns...', | |
| ] | |
| expect( | |
| fullRunPhaseFromLog(lines, '--- Discover (channel candidates) ---', { | |
| step: 'all', | |
| }), | |
| ).toBe('discover') | |
| }) | |
| it('moves to Videos once Catalog banner appears', () => { | |
| const lines = [ | |
| '=== Discover (channel candidates) ===', | |
| '=== Catalog → captions → analyze-light → reports-light ===', | |
| '=== Catalog: max 10 video(s) per channel ===', | |
| '--- Catalog: AL — Anniston ---', | |
| ] | |
| expect(fullRunPhaseFromLog(lines, '--- Catalog: AL — Anniston ---', { step: 'all' })).toBe( | |
| 'videos', | |
| ) | |
| }) | |
| }) | |
| describe('stageOwnsFullRunLog', () => { | |
| it('does not give Videos the Discover log', () => { | |
| expect(stageOwnsFullRunLog('videos', 'discover')).toBe(false) | |
| expect(stageOwnsFullRunLog('discover', 'discover')).toBe(true) | |
| }) | |
| it('gives Videos the shared log only in catalog phase', () => { | |
| expect(stageOwnsFullRunLog('videos', 'videos')).toBe(true) | |
| expect(stageOwnsFullRunLog('discover', 'videos')).toBe(false) | |
| }) | |
| }) | |
| describe('fullRunPhaseLabel', () => { | |
| it('labels Discover clearly', () => { | |
| expect(fullRunPhaseLabel('discover')).toBe('Discover') | |
| }) | |
| }) | |