序号按当前筛选范围的位置计算,不写业务记录或改变导出字段。 后台续载和虚拟滚动沿用绝对索引,空结果/占位行同步列数。 验证:序号首列/连续性/占位与aria行数红绿通过;完整本地门禁及原生备份恢复通过。
This commit is contained in:
@@ -64,6 +64,18 @@ describe('QA operations workbench', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('adds a leading serial column without changing business fields or virtual spacer geometry', () => {
|
||||
const many = Array.from({ length: 200 }, (_, index) => ({ ...item, id: 'row-' + index }))
|
||||
const html = renderToStaticMarkup(<QAOperationsView {...props} page={{ ...page, items: many, total: 200 }} />)
|
||||
expect(html).toMatch(/<thead><tr><th[^>]*>序号<\/th><th>中文问题<\/th>/)
|
||||
expect(html).toMatch(/data-qa-row="row-0"[^>]*><td[^>]*>1<\/td>/)
|
||||
const rows = [...html.matchAll(/data-qa-row="row-(\d+)"[^>]*><td[^>]*>(\d+)<\/td>/g)]
|
||||
expect(rows.length).toBeGreaterThan(1)
|
||||
for (const row of rows) expect(Number(row[2])).toBe(Number(row[1]) + 1)
|
||||
expect(html).toContain('colSpan="17"')
|
||||
expect(html).toContain('aria-rowcount="201"')
|
||||
})
|
||||
|
||||
it('keeps the first rows interactive while later batches load or fail', () => {
|
||||
const prefix = { ...page, total: 2, has_more: true, next_cursor: 'next' }
|
||||
const loading = renderToStaticMarkup(<QAOperationsView {...props} page={prefix} loading={true} />)
|
||||
|
||||
Reference in New Issue
Block a user