🐛 fix(vscode): 移交只对负责人显示;接管后审查会话立即可点
Claude-Session: https://claude.ai/code/session_011cEyL6k351U2BzX1Qmygph
This commit is contained in:
1 parent
71fc38e0c5
commit
07c40897e2
4 files changed
+64
-22
No files matched your search
@@ -11,14 +11,18 @@ import {
|
||||
} from './handoff'
|
||||
|
||||
describe('canStartHandoff', () => {
|
||||
it('gitea 工单、非 done、无待接管 → true', () => {
|
||||
expect(canStartHandoff({ column: 'in-progress' })).toBe(true)
|
||||
expect(canStartHandoff({ column: 'todo', source: 'gitea' })).toBe(true)
|
||||
it('gitea 工单、非 done、无待接管、无 assignee 或 assignee 含我 → true', () => {
|
||||
expect(canStartHandoff({ column: 'in-progress' }, 'me')).toBe(true)
|
||||
expect(canStartHandoff({ column: 'todo', source: 'gitea' }, 'me')).toBe(true)
|
||||
expect(canStartHandoff({ column: 'todo', assignees: [] }, 'me')).toBe(true)
|
||||
expect(canStartHandoff({ column: 'todo', assignees: ['me', 'x'] }, 'me')).toBe(true)
|
||||
})
|
||||
it('done / youtrack / 已在移交中 → false', () => {
|
||||
expect(canStartHandoff({ column: 'done' })).toBe(false)
|
||||
expect(canStartHandoff({ column: 'review', source: 'youtrack' })).toBe(false)
|
||||
expect(canStartHandoff({ column: 'review', handoffAttachmentId: '9' })).toBe(false)
|
||||
it('done / youtrack / 已在移交中 / 不是我负责 → false', () => {
|
||||
expect(canStartHandoff({ column: 'done' }, 'me')).toBe(false)
|
||||
expect(canStartHandoff({ column: 'review', source: 'youtrack' }, 'me')).toBe(false)
|
||||
expect(canStartHandoff({ column: 'review', handoffAttachmentId: '9' }, 'me')).toBe(false)
|
||||
expect(canStartHandoff({ column: 'todo', assignees: ['x'] }, 'me')).toBe(false)
|
||||
expect(canStartHandoff({ column: 'todo', assignees: ['me'] }, undefined)).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -162,4 +166,27 @@ describe('payloads', () => {
|
||||
worktreeExists: false,
|
||||
})
|
||||
})
|
||||
it('接管 UI patch:带 reviewSessionFileExists 时一并下发,UI 不用等下次刷新才能点链接', () => {
|
||||
expect(handoffAcceptedUiPatch({
|
||||
sessions: { reviewSessionId: 'r' },
|
||||
profiles: {},
|
||||
worktreeExists: false,
|
||||
reviewSessionFileExists: true,
|
||||
})).toEqual({
|
||||
handoffAttachmentId: null,
|
||||
handoffFrom: null,
|
||||
reviewSessionId: 'r',
|
||||
worktreePath: null,
|
||||
worktreeExists: false,
|
||||
reviewSessionFileExists: true,
|
||||
})
|
||||
})
|
||||
it('接管 UI patch:reviewSessionFileExists 未传时不出现在 patch 里', () => {
|
||||
const patch = handoffAcceptedUiPatch({
|
||||
sessions: { sessionId: 's' },
|
||||
profiles: {},
|
||||
worktreeExists: false,
|
||||
})
|
||||
expect(patch).not.toHaveProperty('reviewSessionFileExists')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user