test(族谱): 横版断言钉到同代同 left,并固定移动端紧凑卡省作者行
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
This commit is contained in:
@@ -3162,15 +3162,22 @@ describe('GameLineagePage 筛选器 / 主干线 / 信息面板(文档对齐)
|
||||
'创作族谱树',
|
||||
)) as HTMLElement;
|
||||
const view = readCanvasViewport(canvas);
|
||||
// 窄屏图谱视图是**横版**:代际沿 x 推进,且不再渲染左侧代际轴(角标承担代际信息)。
|
||||
// 窄屏图谱视图是**横版**:代际沿 x 推进(同代同 left、兄弟靠 top 分开),
|
||||
// 且不再渲染左侧代际轴(角标承担代际信息)。
|
||||
expect(canvas.querySelector('.game-lineage-canvas__axis')).toBeNull();
|
||||
expect(
|
||||
new Set(
|
||||
[...canvas.querySelectorAll('.game-lineage-node')].map((card) =>
|
||||
Number.parseFloat((card as HTMLElement).style.left),
|
||||
),
|
||||
).size,
|
||||
).toBeGreaterThan(1);
|
||||
const cards = [...canvas.querySelectorAll('.game-lineage-node')].map(
|
||||
(card) => card as HTMLElement,
|
||||
);
|
||||
const generationOne = cards.filter(
|
||||
(card) => card.getAttribute('data-generation') === '1',
|
||||
);
|
||||
expect(generationOne.length).toBeGreaterThanOrEqual(2);
|
||||
expect(new Set(generationOne.map((card) => card.style.left)).size).toBe(
|
||||
1,
|
||||
);
|
||||
expect(new Set(generationOne.map((card) => card.style.top)).size).toBe(
|
||||
generationOne.length,
|
||||
);
|
||||
expect(Math.round(view.scale * 100)).not.toBe(100);
|
||||
expect(canvas.querySelector('.game-lineage-zoom')?.textContent).toBe(
|
||||
`${Math.round(view.scale * 100)}%`,
|
||||
@@ -3185,6 +3192,15 @@ describe('GameLineagePage 筛选器 / 主干线 / 信息面板(文档对齐)
|
||||
expect(
|
||||
visible.some((card) => card.getAttribute('data-generation') === '0'),
|
||||
).toBe(true);
|
||||
// 移动端紧凑卡片按既有设计**省掉作者行**(CSS `.game-lineage-node--compact`:卡片更小、
|
||||
// 字段更少)。作者名在桌面画布、大纲行与详情页都有;这条断言把这个差异固定下来,
|
||||
// 避免它再次变成「实现与断言不同步」。
|
||||
expect(
|
||||
canvas.querySelectorAll('.game-lineage-node--compact').length,
|
||||
).toBe(cards.length);
|
||||
expect(canvas.querySelectorAll('.game-lineage-node__author').length).toBe(
|
||||
0,
|
||||
);
|
||||
} finally {
|
||||
widthSpy.mockRestore();
|
||||
heightSpy.mockRestore();
|
||||
|
||||
Reference in New Issue
Block a user