cmvr-wms/ruoyi-ui-vue3/tests/runtime/cron-preview.spec.js
lixiaolong 149bde836f feat(assistant): 扩展业务助手功能支持更多文档类型和业务场景
- 新增 PDF 文档支持,包括格式校验和完整性检查
- 扩展 Word、TXT 和 ZIP 格式附件处理能力
- 添加 Excel 附件可选择仅作为业务文件不解析行数据
- 实现业务助手表格布局配置新增库存和预算字段
- 集成通知、反馈通知等新的业务助手动作类型
- 完善部门管理包含父级部门和排序字段支持
- 增强业务规则校验涵盖更多系统管理场景
- 优化附件上传限制提示信息更准确
- 添加生成文件下载的安全性校验机制
- 扩展测试覆盖确保各业务动作规则正确性
2026-10-18 08:49:30 +08:00

20 lines
1.0 KiB
JavaScript

import { expect, it } from 'vitest'
import { mount } from '@vue/test-utils'
import { ref, watch, onMounted, nextTick } from 'vue'
// Production component uses the application's auto-imported Vue APIs.
Object.assign(globalThis,{ref,watch,onMounted})
import Result from '../../src/components/Crontab/result.vue'
it('invalid or incomplete expressions show a useful result instead of hanging or throwing',async()=>{
for(const ex of ['0/0 * * * * ?','0/-1 * * * * ?','','0 0','0 0 0 * * ? 1970-999999999','999 0 0 * * ?','x 0 0 * * ?']){
const wrapper=mount(Result,{props:{ex}})
await nextTick()
expect(wrapper.text()).toContain('间隔须大于 0');wrapper.unmount()
}
})
it('normal expressions still produce five future runs',async()=>{
for(const ex of ['0/15 * * * * ?','0 0 9 * * ?','0 0 9 1 * ?','0 0 9 ? * 2-6']){
const wrapper=mount(Result,{props:{ex}});await nextTick()
expect(wrapper.findAll('li')).toHaveLength(5);expect(wrapper.text()).not.toContain('暂无法预览');wrapper.unmount()
}
})