feat: visionneuse d'images - navigation fluide, image ajustee au cadre, fleches laterales et pellicule persistante #111
CI / lint (push) Successful in 2m2s
CI / security (push) Successful in 1m23s
CI / test (push) Successful in 4m23s
CI / build (push) Successful in 1m19s
CI / e2e (push) Successful in 13m27s

This commit is contained in:
2026-09-23 14:37:41 -04:00
parent 8264e7ffae
commit b926f01b85
16 changed files with 460 additions and 70 deletions
+36
View File
@@ -123,4 +123,40 @@ test.describe('Image viewer — zoom / pan / navigation (#108)', () => {
await expect(metaPanel).toBeVisible();
await expect(title).not.toHaveText(titleBefore);
});
test('navigation en place : flèches latérales, pellicule persistante et cadre ajusté (#111)', async ({ page }) => {
await login(page);
await openFile(page, 'TestVault', 'sample-image.png');
const container = page.locator('#content-area .image-viewer-container');
const strip = page.locator('#content-area .image-nav-strip');
const main = page.locator('#content-area img.image-main');
await expect(strip).toBeVisible({ timeout: 10000 });
await expect(strip.locator('img.image-thumb')).toHaveCount(2);
// Marqueur : la navigation en place ne doit PAS recréer le conteneur.
await container.evaluate((el) => { el.dataset.inplace = '1'; });
// L'image reste contenue dans le cadre (jamais plus grande).
const stageBox = await page.locator('#content-area .image-stage').boundingBox();
const imgBox = await main.boundingBox();
expect(imgBox.width).toBeLessThanOrEqual(stageBox.width + 1);
expect(imgBox.height).toBeLessThanOrEqual(stageBox.height + 1);
// Flèche superposée révélée au survol.
const nextArrow = page.locator('#content-area .image-nav-arrow-next');
await expect(nextArrow).toBeAttached();
await nextArrow.hover();
await expect.poll(() => nextArrow.evaluate((el) => getComputedStyle(el).opacity)).toBe('1');
const title = page.locator('#content-area .image-title');
const before = await title.innerText();
await nextArrow.click();
await expect(title).not.toHaveText(before);
await expect(strip).toBeVisible();
await expect(strip.locator('img.image-thumb')).toHaveCount(2);
await expect(container).toHaveAttribute('data-inplace', '1');
await expect(page.locator('#content-area .image-counter')).toContainText('/');
});
});