审批动作前冲刷评论区未发送内容,减少先点发送再审批的一步操作。 关联 #118。 Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
561 B
JavaScript
15 lines
561 B
JavaScript
import assert from 'node:assert/strict'
|
|
import test from 'node:test'
|
|
import { hasOaCommentDraft } from './oa-comment-draft.js'
|
|
|
|
test('empty draft is false', () => {
|
|
assert.equal(hasOaCommentDraft({}), false)
|
|
assert.equal(hasOaCommentDraft({ content: ' ', mentionCount: 0, attachmentCount: 0 }), false)
|
|
})
|
|
|
|
test('text / mention / attachment counts as draft', () => {
|
|
assert.equal(hasOaCommentDraft({ content: '@test' }), true)
|
|
assert.equal(hasOaCommentDraft({ mentionCount: 1 }), true)
|
|
assert.equal(hasOaCommentDraft({ attachmentCount: 2 }), true)
|
|
})
|