fix: restore looping heaven animation footers

This commit is contained in:
leefer
2026-07-24 00:00:55 +08:00
parent eb1e2bca9a
commit 35a41d616c
2 changed files with 117 additions and 24 deletions
+5
View File
@@ -354,6 +354,7 @@ test("heaven reading loading uses the matching canvas scene and stops cleanly",
await expect(canvas).toBeVisible();
await expect(canvas).toHaveAttribute("data-scene", scene);
await expect(canvas).toHaveAttribute("data-running", "true");
await expect(canvas).toHaveAttribute("data-looping", "true");
await page.waitForTimeout(180);
const pixels = await canvas.evaluate((element) => {
const context = element.getContext("2d");
@@ -368,6 +369,9 @@ test("heaven reading loading uses the matching canvas scene and stops cleanly",
expect(pixels.width).toBeGreaterThan(300);
expect(pixels.height).toBeGreaterThan(300);
expect(pixels.colors).toBeGreaterThan(3);
await page.evaluate(() => { heavenReadingAnimation.startedAt = performance.now() - 13_100; });
await expect(canvas).toHaveAttribute("data-cycle", "1");
await expect(canvas).toHaveAttribute("data-running", "true");
if (mode === "trend") {
const completionMs = await page.evaluate(async () => {
const started = performance.now();
@@ -380,6 +384,7 @@ test("heaven reading loading uses the matching canvas scene and stops cleanly",
}
await page.locator("#closeHeavenReadingDialog").click();
await expect(canvas).toHaveAttribute("data-running", "false");
await expect(canvas).toHaveAttribute("data-looping", "false");
}
});