fully rework/condense/simplify AdaptiveImage.svelte

This commit is contained in:
midzelis
2026-03-04 04:12:19 +00:00
parent 872a6ae993
commit 3467897113
13 changed files with 450 additions and 649 deletions

View File

@@ -28,10 +28,9 @@ test.describe('Photo Viewer', () => {
const original = page.getByTestId('original').filter({ visible: true });
await expect(thumbnail).toHaveAttribute('src', /thumbnail/);
const box = await thumbnail.boundingBox();
expect(box).toBeTruthy();
const { x, y, width, height } = box!;
await page.mouse.move(x + width / 2, y + height / 2);
const { width, height } = page.viewportSize()!;
await page.mouse.move(width / 2, height / 2);
await page.mouse.wheel(0, -1);
await expect(original).toBeInViewport();
await expect(original).toHaveAttribute('src', /original/);
@@ -44,10 +43,9 @@ test.describe('Photo Viewer', () => {
const original = page.getByTestId('original').filter({ visible: true });
await expect(thumbnail).toHaveAttribute('src', /thumbnail/);
const box = await thumbnail.boundingBox();
expect(box).toBeTruthy();
const { x, y, width, height } = box!;
await page.mouse.move(x + width / 2, y + height / 2);
const { width, height } = page.viewportSize()!;
await page.mouse.move(width / 2, height / 2);
await page.mouse.wheel(0, -1);
await expect(original).toHaveAttribute('src', /fullsize/);
});