✨ feat(vscode): 申请移交时给负责人发系统通知
This commit is contained in:
1 parent
5bcbb87152
commit
a1fac829f8
3 files changed
+108
-1
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { canAnswerHandoffRequest, canAskHandoff, canCancelHandoffRequest, handoffRequestNotices } from './handoffRequest'
|
||||
import { canAnswerHandoffRequest, canAskHandoff, canCancelHandoffRequest, handoffRequestNotices, handoffRequestSystemNotice } from './handoffRequest'
|
||||
|
||||
const review = {
|
||||
source: 'gitea' as const,
|
||||
@@ -37,6 +37,34 @@ describe('移交申请', () => {
|
||||
.toEqual(['#435 没交出来:会话太大'])
|
||||
})
|
||||
|
||||
it('系统通知只打给负责人,同一条申请不重复', () => {
|
||||
expect(handoffRequestSystemNotice({
|
||||
issueNumber: 435,
|
||||
me: 'chw',
|
||||
assignees: ['chw'],
|
||||
from: 'cruldra',
|
||||
})).toBe('cruldra 想要 #435')
|
||||
expect(handoffRequestSystemNotice({
|
||||
issueNumber: 435,
|
||||
me: 'chw',
|
||||
assignees: ['chw'],
|
||||
from: 'cruldra',
|
||||
seenFrom: 'cruldra',
|
||||
})).toBeUndefined()
|
||||
expect(handoffRequestSystemNotice({
|
||||
issueNumber: 435,
|
||||
me: 'cruldra',
|
||||
assignees: ['chw'],
|
||||
from: 'cruldra',
|
||||
})).toBeUndefined()
|
||||
expect(handoffRequestSystemNotice({
|
||||
issueNumber: 435,
|
||||
me: 'other',
|
||||
assignees: ['chw'],
|
||||
from: 'cruldra',
|
||||
})).toBeUndefined()
|
||||
})
|
||||
|
||||
it('只有负责人能同意或拒绝', () => {
|
||||
const pending = { ...review, handoffRequestFrom: 'cruldra' }
|
||||
expect(canAnswerHandoffRequest(pending, 'chw')).toBe(true)
|
||||
|
||||
Reference in new issue
Block a user