优化:产品查询数据库分页并修复报告测试契约
This commit is contained in:
@@ -248,3 +248,13 @@ test('fine defect expansion and Excel share authorized parent/child values, pres
|
||||
assert.equal(fields.some(f=>f.key.startsWith('black-defect-')||f.key.startsWith('black-fine-')),false);
|
||||
assert.equal(data.groups[0].children[0].rate,0);
|
||||
});
|
||||
|
||||
|
||||
test('remote page two is not sliced again and full export includes every row',async()=>{
|
||||
const all=Array.from({length:35},(_,i)=>({...row,key:String(i),label:'产品'+i}));let changed;
|
||||
const ui=fixture({rows:all.slice(15,30),view:'product',remotePage:{current:2,pageSize:15,total:35,onChange:(...args)=>changed=args},loadExportData:async()=>({rows:all})});
|
||||
assert.equal(find(ui.tree,n=>n.type==='Table').props.dataSource.length,15);
|
||||
const pagination=find(ui.tree,n=>n.type==='Pagination');assert.equal(pagination.props.total,35);assert.equal(pagination.props.current,2);
|
||||
pagination.props.onChange(3,15);assert.deepEqual(changed,[3,15]);
|
||||
await ui.ref.exportExcel();assert.equal(ui.exported.workbook.getWorksheet('质量汇总').rowCount,37);assert.equal(ui.exported.rows[0].key,'0');assert.equal(ui.exported.rows.at(-1).key,'34');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user