perf(web): 优化大数据量页面切换与聚合性能
This commit is contained in:
@@ -3,16 +3,33 @@ import assert from 'node:assert/strict';
|
||||
|
||||
import {
|
||||
REQUIREMENT_TABLE_BADGE_CLASS,
|
||||
REQUIREMENT_TABLE_CLASS,
|
||||
REQUIREMENT_TABLE_COLUMN_WIDTHS,
|
||||
REQUIREMENT_TABLE_CONTAINER_CLASS,
|
||||
REQUIREMENT_TABLE_HEADER_CELL_CLASS,
|
||||
getRequirementTableTextClass,
|
||||
} from './requirement-table-layout';
|
||||
|
||||
test('uses fixed table layout without horizontal scrolling for requirement list', () => {
|
||||
assert.match(REQUIREMENT_TABLE_CLASS, /\btable-fixed\b/);
|
||||
assert.doesNotMatch(REQUIREMENT_TABLE_CLASS, /\bmin-w-\[/);
|
||||
assert.doesNotMatch(REQUIREMENT_TABLE_CONTAINER_CLASS, /\boverflow-x-auto\b/);
|
||||
|
||||
const totalWidth = REQUIREMENT_TABLE_COLUMN_WIDTHS.reduce((sum, width) => sum + width, 0);
|
||||
assert.equal(totalWidth, 100);
|
||||
});
|
||||
|
||||
test('keeps requirement table headers on one line', () => {
|
||||
assert.match(REQUIREMENT_TABLE_HEADER_CELL_CLASS, /\bwhitespace-nowrap\b/);
|
||||
});
|
||||
|
||||
test('keeps requirement table badges on one line', () => {
|
||||
assert.match(REQUIREMENT_TABLE_BADGE_CLASS, /\bwhitespace-nowrap\b/);
|
||||
assert.match(REQUIREMENT_TABLE_BADGE_CLASS, /\bshrink-0\b/);
|
||||
});
|
||||
|
||||
test('clips long requirement source project type and creator cells', () => {
|
||||
for (const column of ['source', 'project', 'type', 'creator'] as const) {
|
||||
test('clips long requirement source project type version and creator cells', () => {
|
||||
for (const column of ['source', 'project', 'type', 'version', 'creator'] as const) {
|
||||
const className = getRequirementTableTextClass(column);
|
||||
|
||||
assert.match(className, /\btruncate\b/);
|
||||
|
||||
Reference in New Issue
Block a user