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
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user