test: 补齐采购金额界面的共享草稿测试数据
This commit is contained in:
parent
771574fef7
commit
e9b93e586f
@ -24,7 +24,7 @@ it('real purchase columns, batch totals and footer keep actual amounts before qu
|
||||
visit(baseParse(template));expect(grid).toBeTruthy();expect(footer).toBeTruthy();expect(totals).toHaveLength(2)
|
||||
const extract=node=>template.slice(node.loc.start.offset,node.loc.end.offset)
|
||||
const host=defineComponent({template:`<div><el-table class="detail" :data="sheet.rows">${extract(grid)}</el-table><el-table class="batches" :data="sheet.rows">${totals.map(extract).join('')}</el-table><section class="summary">${extract(footer)}</section></div>`,
|
||||
data:()=>({canViewQuotes:true,compactAmounts:false,extras:false,batchProject:{mixed:false},sheet:{rows:[{_key:'r',quantity:2,unit:'个',actualUnitPrice:3,finalUnitPrice:5,actualTotalAmount:6,totalAmount:10}]},cellOwner:{},editCell:null}),
|
||||
data:()=>({canViewQuotes:true,compactAmounts:false,extras:false,batchProject:{mixed:false},sheet:{rows:[{_key:'r',quantity:2,unit:'个',actualUnitPrice:3,finalUnitPrice:5,actualTotalAmount:6,totalAmount:10}]},cellOwner:{},editCell:null,sharedDraftRows:[]}),
|
||||
computed:{columns(){return Sheet.computed.columns.call(this)},visibleRows(){return this.sheet.rows},actualTotal:()=>6,amount:()=>10,unpriced:()=>0},
|
||||
methods:{pendingCategory:()=>false,selectColumn(){},isGridSelected:()=>false,isGridTypingCell:()=>false,originalIndex:()=>0,actualAmount:row=>row.quantity*row.actualUnitPrice,hasPrice:()=>true,money:value=>Number(value).toFixed(2)}})
|
||||
const wrapper=mount(host,{global:{plugins:[ElementPlus],stubs:{PurchaseCell:true,BusinessIcon:true}}})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user