- 新增 user.check 功能用于核对人员是否已有系统账号 - 在 assistant-table-layout.js 中为用户表格添加 checkedIdentity 和 matchResult 字段 - 优化 AssistantConversationService 中的任务记忆和澄清流程 - 支持对草稿特定行进行修改,无需重新填写整张表 - 限制 user.check 操作最大查询数量为 100 条记录 - 实现中断任务恢复机制,保持原始请求上下文 - 添加针对多行数据选择性修改的目标行标识支持
15 lines
1.4 KiB
JavaScript
15 lines
1.4 KiB
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { draftReviewCount, draftNeedsRichNoticeReview } from '../src/core/assistant-display.ts'
|
|
test('broadcast review counts recipients so the existing twenty item confirmation guard applies', () => {
|
|
assert.equal(draftReviewCount({ action: 'notification.send', rows: [{ _notificationPreview: { recipientCount: 401, recipients: [{ id: 1 }] } }] }), 401)
|
|
assert.equal(draftReviewCount({ action: 'notification.send', rows: [{ _notificationPreview: { recipients: Array.from({ length: 21 }, (_, id) => ({ id })) } }] }), 21)
|
|
assert.equal(draftReviewCount({ action: 'notification.send', rows: [{ _notificationPreview: { recipientCount: 3 } }, { _notificationPreview: { recipientCount: 2 } }] }), 5)
|
|
assert.equal(draftReviewCount({ action: 'purchase.referencePrice', rows: [{ _referencePricePreview: [1, 2] }] }), 2)
|
|
})
|
|
test('image announcements require full graphical review on web, without blocking ordinary inbox drafts', () => {
|
|
assert.equal(draftNeedsRichNoticeReview({ action: 'notice.create', rows: [{ noticeContent: '<p>说明</p><img src="/static/assistant-guides/feedback-1.svg">' }] }), true)
|
|
assert.equal(draftNeedsRichNoticeReview({ action: 'notice.update', rows: [{ noticeContent: '<IMG src="/a.png">' }] }), true)
|
|
assert.equal(draftNeedsRichNoticeReview({ action: 'notification.send', rows: [{ content: '普通通知' }] }), false)
|
|
})
|