mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-11-12 14:20:40 +00:00
fix: retain original image titles when proxying previews
This commit is contained in:
14
tests/e2e/specs/picture-title.spec.ts
Normal file
14
tests/e2e/specs/picture-title.spec.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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');
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user