test: sidebar clone-step label test with a full request

This commit is contained in:
Neil
2026-11-10 16:47:21 -08:00
parent 2c3cf43448
commit 4c64849163
2 changed files with 26 additions and 34 deletions
@@ -7,7 +7,6 @@ import { deriveVmBuildSteps } from './vm-build-steps'
import { classifyVmBuildFailure } from './vm-build-failure'
import { holdRunningSteps } from './use-minimum-running-steps'
import { humanizeOrcaCloudLogLine } from './orca-cloud-build-log'
import { getCreationProgressLabel } from '@/lib/workspace/creation/pending-worktree-creation'
import type { Translate } from '@/i18n/use-translate'
const base = {
@@ -296,39 +295,6 @@ describe('Orca Cloud clone step', () => {
})
})
it('the sidebar line follows the active step', () => {
const t: Translate = (_key, fallback) => fallback
const entry = (
provisioningLog: string,
environmentCheck?: { status: 'running'; startedAt: number }
) => ({
status: 'creating' as const,
phase: 'provisioning-vm' as const,
request: {
repoId: 'r',
name: 'n',
setupDecision: 'skip' as const,
ephemeralVmRecipe: {
sourceRepoId: 'r',
recipeId: 'cloud',
projectId: 'p',
provider: 'orca-cloud' as const
}
},
provisioningLog,
...(environmentCheck ? { environmentCheck } : {})
})
expect(getCreationProgressLabel(entry('[orca-cloud] provisioning\n'), t)).toBe(
'Starting sandbox…'
)
expect(getCreationProgressLabel(entry('[orca-cloud] cloning\n'), t)).toBe(
'Cloning the repository…'
)
expect(
getCreationProgressLabel(entry('[orca-cloud] cloning\n[orca-cloud] connecting\n'), t)
).toBe('Preparing environment…')
})
it('progress lines stay out of the plain log', () => {
const t: Translate = (_key, fallback) => fallback
expect(humanizeOrcaCloudLogLine('[orca-cloud] cloning', t)).toBe('Cloning the repository…')
@@ -46,3 +46,29 @@ it('speaks of a sandbox for Orca Cloud and keeps VM wording for bring-your-own r
expect(label('orca-cloud', { status: 'running', startedAt: 1 })).toBe('Preparing environment…')
expect(label(undefined)).toBe('Provisioning VM…')
})
it('the Orca Cloud sidebar line follows the clone step', () => {
const at = (provisioningLog: string) =>
getCreationProgressLabel(
{
status: 'creating',
phase: 'provisioning-vm',
indeterminate: false,
provisioningLog,
request: request({
ephemeralVmRecipe: {
sourceRepoId: 'r',
recipeId: 'cloud',
projectId: 'p',
provider: 'orca-cloud'
}
})
},
t
)
expect(at('[orca-cloud] provisioning\n')).toBe('Starting sandbox…')
expect(at('[orca-cloud] cloning\n[orca-cloud] clone-progress 40 download\n')).toBe(
'Cloning the repository…'
)
expect(at('[orca-cloud] cloning\n[orca-cloud] connecting\n')).toBe('Preparing environment…')
})