- 集成 ServerConnection 组件用于开发环境服务器切换 - 实现多服务器令牌隔离存储机制 - 添加 ArrivalOperation 屏幕处理到货和验收流程 - 支持待登记到货和待验收状态切换 - 优化库存操作界面的字段显示逻辑 - 增强 Excel 文件分片上传支持产品文件识别 - 添加 AI 助手会话滚动跟踪功能 - 实现开发服务器地址持久化存储 - 优化登录界面集成服务器连接组件 - 添加领用出库功能支持项目物资使用 - 改进盘点确认生效的操作流程 - 增强采购到货登记和验收的权限控制 - 优化移动端文件上传的断点续传机制 - 添加服务器切换时的数据清理保护机制 - 实现紧凑金额显示模式减少界面冗余 - 增强库存操作的数量验证和错误提示 - 优化 AI 助手的会话状态同步机制
7 lines
1.5 KiB
JavaScript
7 lines
1.5 KiB
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import {productAttachmentError,productAttachmentMaximum,productEditionSpec,productVersionLabel,productAttachmentPath,uncertainEditionResult} from '../../src/utils/product-editions.js'
|
|
test('product editions are freely named rather than restricted to numeric generations',()=>{for(const name of ['V1.2','试制版','量产版','2026改进款']){assert.equal(productEditionSpec('机器人',name),'机器人 / '+name);assert.equal(productVersionLabel({seriesName:'协作机器人',editionTag:name}),'协作机器人 · '+name)}})
|
|
test('product attachments accept exactly fifty MiB and reject empty, oversized and executable files',()=>{assert.equal(productAttachmentMaximum,50*1024*1024);assert.equal(productAttachmentError({name:'工程图纸.STEP',size:productAttachmentMaximum}),'');assert.ok(productAttachmentError({name:'图纸.pdf',size:productAttachmentMaximum+1}));assert.ok(productAttachmentError({name:'空.pdf',size:0}));for(const name of ['run.exe','网页.html','矢量.svg'])assert.ok(productAttachmentError({name,size:100}))})
|
|
test('product paths remain owner scoped and uncertain creation keeps the original request',()=>{assert.equal(productAttachmentPath(4),'/production/product/4/attachments');for(const id of ['../4',0,NaN,1.2])assert.throws(()=>productAttachmentPath(id));assert.equal(uncertainEditionResult({code:'ECONNABORTED'}),true);assert.equal(uncertainEditionResult(new Error('版本名重复')),false)})
|