- 在 .env.production 中新增 VITE_AUTH_COOKIE_NAME 配置项用于设置认证cookie名称 - 将 AcceptanceException.vue 中的表单标签宽度从固定90px改为自动适配 - 在 ActionDialog.vue 中将多个表单项标记为必填项并调整标签宽度为自动适配 - 重构 ActionHistory.vue 中的按钮布局结构并添加表格列样式类名 - 更新 api-contract-audit.cjs 添加生产任务和BOM相关接口的契约测试 - 修改 auth.js 使用动态认证cookie键名替换硬编码的Admin-Token - 调整系统角色授权用户页面的表单布局和表格样式类名 - 优化 ReceiptDialog Batch 组件的对话框尺寸、表单验证和分页功能
25 lines
1.5 KiB
JavaScript
25 lines
1.5 KiB
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import {sourceWasRecorded,markRecordedPage,encodeHistoricalFields} from '../../src/utils/history-entry-result.js'
|
|
test('timeout recovery requires the exact saved source, not a similar search result',()=>{
|
|
assert.equal(sourceWasRecorded([{sourceId:760,saved:true}],760),true)
|
|
assert.equal(sourceWasRecorded([{sourceId:1760,saved:true}],760),false)
|
|
assert.equal(sourceWasRecorded([{sourceId:760,saved:false}],760),false)
|
|
assert.equal(sourceWasRecorded(undefined,760),false)
|
|
})
|
|
test('a confirmed individual form updates one visible row without duplicate count increments',()=>{
|
|
const source=[{sourceId:1,saved:false},{sourceId:2,saved:false}]
|
|
const first=markRecordedPage(source,1,true)
|
|
assert.deepEqual(first,{changed:true,rows:[source[1]]})
|
|
assert.equal(markRecordedPage(first.rows,1,true).changed,false)
|
|
const marked=markRecordedPage(source,2,false)
|
|
assert.equal(marked.rows[1].saved,true);assert.equal(source[1].saved,false)
|
|
assert.equal(markRecordedPage(marked.rows,2,false).changed,false)
|
|
})
|
|
test('historical text uses lossless UTF-8 transport without disabling the input filter',()=>{
|
|
const fields={os:'Windows >=10',data:'<script>alert("x")</script> & 中文🙂',nullable:null,long:'中'.repeat(20000)}
|
|
const encoded=encodeHistoricalFields(fields)
|
|
assert.match(encoded,/^[A-Za-z0-9+/=]+$/)
|
|
assert.deepEqual(JSON.parse(new TextDecoder().decode(Uint8Array.from(atob(encoded),c=>c.charCodeAt(0)))),fields)
|
|
})
|