Download desktop/src/components/shared/ProjectContextChip.test.tsx from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/components/shared/ProjectContextChip.test.tsx
- Command line
-
hf download hf://chenbhao/codev@e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/components/shared/ProjectContextChip.test.tsx
-
curl -L -o ProjectContextChip.test.tsx https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/components/shared/ProjectContextChip.test.tsx
1.22 kB
| import { render, screen } from '@testing-library/react' | |
| import { describe, expect, it } from 'vitest' | |
| import '@testing-library/jest-dom' | |
| import { ProjectContextChip } from './ProjectContextChip' | |
| describe('ProjectContextChip', () => { | |
| it('keeps the source project label and adds worktree identity', () => { | |
| render( | |
| <ProjectContextChip | |
| workDir="/workspace/OpenCutSkill/.claude/worktrees/desktop-main-54a09f85" | |
| sourceWorkDir="/workspace/OpenCutSkill" | |
| repoName={null} | |
| branch="main" | |
| isWorktree | |
| worktreeSlug="desktop-main-54a09f85" | |
| />, | |
| ) | |
| expect(screen.getByText('OpenCutSkill')).toBeInTheDocument() | |
| expect(screen.getByText('main')).toBeInTheDocument() | |
| expect(screen.getByText('worktree')).toBeInTheDocument() | |
| expect(screen.getByText('desktop-main-54a09f85')).toBeInTheDocument() | |
| }) | |
| it('does not show worktree details for a normal checkout', () => { | |
| render( | |
| <ProjectContextChip | |
| workDir="/workspace/OpenCutSkill" | |
| repoName={null} | |
| branch="main" | |
| />, | |
| ) | |
| expect(screen.getByText('OpenCutSkill')).toBeInTheDocument() | |
| expect(screen.queryByText('worktree')).not.toBeInTheDocument() | |
| }) | |
| }) | |