审批动作前冲刷评论区未发送内容,减少先点发送再审批的一步操作。 关联 #118。 Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
655 B
TypeScript
17 lines
655 B
TypeScript
import { describe, it } from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { hasOaCommentDraft } from './oa-comment-draft.ts'
|
|
|
|
describe('hasOaCommentDraft', () => {
|
|
it('treats blank content without mentions/files as empty', () => {
|
|
assert.equal(hasOaCommentDraft({}), false)
|
|
assert.equal(hasOaCommentDraft({ content: ' ', mentionCount: 0, attachmentCount: 0 }), false)
|
|
})
|
|
|
|
it('detects text, mentions and attachments', () => {
|
|
assert.equal(hasOaCommentDraft({ content: '@test' }), true)
|
|
assert.equal(hasOaCommentDraft({ mentionCount: 1 }), true)
|
|
assert.equal(hasOaCommentDraft({ attachmentCount: 2 }), true)
|
|
})
|
|
})
|