cmvr-wms/ruoyi-ui-vue3/tests/unit/feedback-notification.test.mjs
lixiaolong 03b5e82dde feat(storage): 集成MinIO对象存储和邮件通知功能
- 配置Spring Mail发送通知邮件,支持环境变量配置SMTP参数
- 添加notification-center和feedback-notification模块开关及配置
- 集成MinIO作为业务附件对象存储,支持采购文档、供应商执照等文件存储
- 修改AssistantAttachmentService使用对象存储保存AI助手附件
- 更新FeedbackImageStorage使用对象存储管理反馈图片
- 改进FileUploadUtils和FileUtils使用对象存储处理文件上传下载
- 扩展PurchaseDocumentService和SupplierLicenseService支持对象存储
- 添加WmsBatchImportServiceImpl对批量导入文件的对象存储支持
- 实现ExcelUtil导出时可选存储到对象存储而非本地文件系统
- 增加SysFeedbackService反馈提交后的邮件通知功能
- 添加用户反馈组件的通知设置界面和通知详情展示
- 创建sys_feedback_notify_route和sys_feedback_notification数据表
- 创建sys_notification_event和sys_notification_delivery数据表
- 添加BusinessAttachmentMinioLiveTest集成测试用例
2026-10-16 22:42:36 +08:00

29 lines
1.5 KiB
JavaScript

import assert from 'node:assert/strict'
import test from 'node:test'
import { readFileSync } from 'node:fs'
const read = name => readFileSync(new URL(`../../src/components/UserFeedback/${name}.vue`, import.meta.url), 'utf8')
test('recipient settings and notification details remain administrator-only, outside menus', () => {
const source = read('index')
assert.match(source, /<el-tab-pane v-if="canManage" label="通知设置"/)
assert.match(source, /<NotificationDetail v-if="canManage"/)
assert.match(source, /tab === 'notifications' && canManage/)
assert.match(source, /\['mine', 'all'\]\.includes\(tab.value\)/)
})
test('mail preview is plain text and requires separate explicit send, never an AI-chosen address', () => {
const source = read('NotificationDetail')
assert.match(source, /<pre>\{\{ plan.body \}\}<\/pre>/)
assert.doesNotMatch(source, /v-html|el-dialog/)
assert.match(source, /确认发送邮件/)
assert.match(source, /previewToken: plan.value.previewToken/)
assert.match(source, /retryConfirmed/)
assert.match(source, /onBeforeUnmount\(\(\) => \{ generation\+\+; clearTimeout\(timer\)/)
})
test('roles use current membership and auto-send has a clear opt-in warning', () => {
const source = read('NotificationSettings')
assert.match(source, /roleIds: item.roleIds/)
assert.match(source, /管理员预览后发送/)
assert.match(source, /保存即允许此模块的新反馈自动通知/)
assert.match(source, /不会补发历史反馈/)
assert.match(source, /只有管理员可查看全部反馈/)
})