Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

test(web): 按分区坐标测量沉浸入口悬停

longmeidao02029e1fa4a1
diff --git a/frontend/e2e/design-cards.test.ts b/frontend/e2e/design-cards.test.ts
index 493467499..069ccb613 100644
--- a/frontend/e2e/design-cards.test.ts
+++ b/frontend/e2e/design-cards.test.ts
@@ -138,10 +138,16 @@ describe('设计决定:作品卡、管理页与复核', () => {
'竖屏带的「进入沉浸模式」换了字形');
const immerse = page.locator('#grid [data-shorts-enter]').first();
await immerse.scrollIntoViewIfNeeded();
- const resting = await immerse.boundingBox();
+ const measureImmerse = () => immerse.evaluate((node) => {
+ const button = node.getBoundingClientRect();
+ const strip = node.closest('[data-shorts-strip]')!.getBoundingClientRect();
+ return { x: button.x - strip.x, y: button.y - strip.y,
+ width: button.width, height: button.height, transform: getComputedStyle(node).transform };
+ });
+ const resting = await measureImmerse();
await immerse.hover();
await page.waitForTimeout(180);
- const hovering = await immerse.boundingBox();
+ const hovering = await measureImmerse();
assert.deepEqual(hovering, resting, '沉浸入口悬停保持原位与尺寸');
const shortCard = page.locator('#grid [data-shorts-row] [data-media-card]').first();
await shortCard.hover();