fix(pl): 防止图片识别回填已锁定的证面引用
This commit is contained in:
1 parent
262ed3971c
commit
57d61f24db
3 files changed
+29
-2
No files matched your search
@@ -566,3 +566,26 @@ test('referenced bindings and references cannot be edited or removed', async ()
|
||||
h.stop()
|
||||
}
|
||||
})
|
||||
|
||||
test('recognition cannot populate locked empty references while other empty fields remain fillable', async () => {
|
||||
const h = harness(),
|
||||
s = h.state
|
||||
try {
|
||||
h.setCert({ referencesEditable: false, purchaseRefs: [], attachmentUrls: 'one.png' })
|
||||
s.kind.value = 'transport'
|
||||
await s.edit({ id: 'cert' })
|
||||
const parsing = s.recognize()
|
||||
h.parses[0].resolve({
|
||||
candidates: {
|
||||
purchaseRefs: [{ referenceType: 'unknown', referenceNo: 'OCR-NEW' }],
|
||||
shipperName: '合成托运单位'
|
||||
},
|
||||
invalidFields: {}
|
||||
})
|
||||
await parsing
|
||||
assert.deepEqual(s.form.value.purchaseRefs, [])
|
||||
assert.equal(s.form.value.shipperName, '合成托运单位')
|
||||
} finally {
|
||||
h.stop()
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user