Files
file-online-preview/tests/e2e/specs/picture-title.spec.ts

15 lines
601 B
Java

import { test, expect } from '@playwright/test';
const fixtureBase = process.env.FIXTURE_BASE_URL || 'http://127.0.0.1:18080';
for (const proxy of [false, true]) {
test(`image title retains the source filename with kkagent=${proxy}`, async ({ page }) => {
const source = `${fixtureBase}/sample.png`;
const encoded = encodeURIComponent(Buffer.from(source).toString('base64'));
const response = await page.goto(`/onlinePreview?url=${encoded}&kkagent=${proxy}`);
expect(response?.status()).toBe(200);
await expect(page.locator('.viewer-title')).toHaveText('sample.png');
});
}