Files
openchamber/packages/ui/src/lib/projectResolution.test.ts
T
Bohdan Triapitsyn 22b3665077 feat: show work status on draft sessions and resolve project worktrees
Keeps the work status panel aligned to the draft's target directory
Resolves project labels for sibling worktrees using shared session-directory logic
Adds coverage for resolving a worktree back to its registered project
2026-08-11 17:00:23 +03:00

22 lines
727 B
TypeScript

import { describe, expect, test } from 'bun:test';
import { resolveProjectForSessionDirectory } from './projectResolution';
const projects = [
{ id: 'openchamber', path: '/workspace/openchamber', label: 'OpenChamber' },
];
describe('resolveProjectForSessionDirectory', () => {
test('resolves a sibling worktree to its registered project', () => {
const worktrees = new Map([
['/workspace/openchamber', [{
path: '/workspace/openchamber-feature',
projectDirectory: '/workspace/openchamber',
branch: 'feature',
label: 'feature',
}]],
]);
expect(resolveProjectForSessionDirectory(projects, worktrees, '/workspace/openchamber-feature')).toEqual(projects[0]);
});
});