mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-11-11 13:50:44 +00:00
15 lines
601 B
Java
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');
|
|
});
|
|
}
|