优化
This commit is contained in:
@@ -154,3 +154,18 @@ test('purchase category is optional while its length remains bounded', () => {
|
||||
assert.equal(payload.purchaseCategory, '')
|
||||
assert.throws(() => presentation.buildProcurementCreate({ ...draft(), purchaseCategory: 'x'.repeat(129) }, 'Company', 'key'), /品类/)
|
||||
})
|
||||
|
||||
|
||||
test('domestic purchase creates an export order and displays the actual origin and destination regions', () => {
|
||||
const payload = presentation.buildProcurementCreate({ ...draft(), procurementDirection: 'DOMESTIC_TO_OVERSEAS', receivingAddress: 'US, CA, Los Angeles, test destination' }, 'Authenticated Company', 'export-key')
|
||||
assert.equal(payload.procurementDirection, 'DOMESTIC_TO_OVERSEAS')
|
||||
assert.equal(payload.receivingAddress, 'US, CA, Los Angeles, test destination')
|
||||
assert.equal(presentation.statusLabel('WAIT_OVERSEAS_RECEIPT', payload.procurementDirection), '待国内到仓')
|
||||
assert.equal(presentation.statusLabel('DOMESTIC_RECEIVING', payload.procurementDirection), '海外收货中')
|
||||
assert.equal(presentation.statusLabel('WAIT_CHARGES', payload.procurementDirection), '待海外核费')
|
||||
assert.equal(presentation.statusLabel('WAIT_OVERSEAS_RECEIPT'), '待海外到仓')
|
||||
assert.throws(() => presentation.buildProcurementCreate({ ...draft(), procurementDirection: 'INVALID' }, 'Company', 'key'), /采购方向/)
|
||||
const source = readFileSync(new URL('./views/ProcurementView.vue', import.meta.url), 'utf8')
|
||||
assert.match(source, /v-model="form.procurementDirection"/)
|
||||
assert.match(source, /regionText\('最终国内收件资料', form.procurementDirection\)/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user