fix(team): preserve worktree isolation in edit snapshots
This commit is contained in:
parent
708e1c3bf2
commit
94b97c4930
2 changed files with 33 additions and 0 deletions
|
|
@ -138,6 +138,7 @@ function normalizeEditableMemberSnapshot(member: {
|
||||||
providerId?: TeamProviderId;
|
providerId?: TeamProviderId;
|
||||||
model?: string;
|
model?: string;
|
||||||
effort?: EffortLevel;
|
effort?: EffortLevel;
|
||||||
|
isolation?: 'worktree';
|
||||||
} | null {
|
} | null {
|
||||||
if (member.removedAt) {
|
if (member.removedAt) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -208,4 +208,36 @@ describe('getMembersRequiringRuntimeRestart', () => {
|
||||||
|
|
||||||
expect(refreshed).toBe(base);
|
expect(refreshed).toBe(base);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('keeps worktree isolation in the edit source snapshot', () => {
|
||||||
|
const sharedWorkspace = buildEditTeamSourceSnapshot({
|
||||||
|
name: 'Team A',
|
||||||
|
description: 'desc',
|
||||||
|
color: 'blue',
|
||||||
|
members: [
|
||||||
|
{
|
||||||
|
name: 'alice',
|
||||||
|
role: 'Reviewer',
|
||||||
|
} as any,
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const isolatedWorkspace = buildEditTeamSourceSnapshot({
|
||||||
|
name: 'Team A',
|
||||||
|
description: 'desc',
|
||||||
|
color: 'blue',
|
||||||
|
members: [
|
||||||
|
{
|
||||||
|
name: 'alice',
|
||||||
|
role: 'Reviewer',
|
||||||
|
isolation: 'worktree',
|
||||||
|
} as any,
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(isolatedWorkspace).not.toBe(sharedWorkspace);
|
||||||
|
expect(JSON.parse(isolatedWorkspace).members[0]).toMatchObject({
|
||||||
|
isolation: 'worktree',
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue