This commit is contained in:
2026-10-09 17:36:40 +08:00
parent 95078f750e
commit e251a1c570
3 changed files with 29 additions and 1 deletions
+10
View File
@@ -11,6 +11,16 @@ import {
import { session } from '../src/stores/session.js'
import { toDispatchError } from '../src/utils/dispatch-error.js'
test('dispatch network failures show recovery guidance and retain diagnostics', () => {
const error = toDispatchError({ message: 'request:fail', network: true, code: 'NETWORK_ERROR', requestId: 'network-request', traceId: 'network-trace' })
assert.equal(error.message, '网络连接失败,请检查网络后重试,当前作业已保留')
assert.equal(error.network, true)
assert.equal(error.code, 'NETWORK_ERROR')
assert.equal(error.requestId, 'network-request')
assert.equal(error.traceId, 'network-trace')
assert.equal(toDispatchError({ message: '业务校验失败' }).message, '业务校验失败')
})
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8')
test('dispatch merge retains return carton picking and review gates together', async () => {