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
22 lines
727 B
TypeScript
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]);
|
|
});
|
|
});
|