test(e2e): phase-2 add office and zip smoke coverage

This commit is contained in:
kl
2026-03-04 11:11:06 +08:00
parent a0d78c57e3
commit 8f9dda5a8d
8 changed files with 87 additions and 6 deletions

View File

@@ -51,13 +51,33 @@ test('08 png preview', async ({ request }) => {
expect(resp.status()).toBe(200);
});
test('09 security: block 10.x host in onlinePreview', async ({ request }) => {
test('09 docx preview', async ({ request }) => {
const resp = await openPreview(request, `${fixtureBase}/sample.docx`);
expect(resp.status()).toBe(200);
});
test('10 xlsx preview', async ({ request }) => {
const resp = await openPreview(request, `${fixtureBase}/sample.xlsx`);
expect(resp.status()).toBe(200);
});
test('11 pptx preview', async ({ request }) => {
const resp = await openPreview(request, `${fixtureBase}/sample.pptx`);
expect(resp.status()).toBe(200);
});
test('12 zip preview', async ({ request }) => {
const resp = await openPreview(request, `${fixtureBase}/sample.zip`);
expect(resp.status()).toBe(200);
});
test('13 security: block 10.x host in onlinePreview', async ({ request }) => {
const resp = await openPreview(request, `http://10.1.2.3/a.pdf`);
const body = await resp.text();
expect(body).toContain('不受信任');
});
test('10 security: block 10.x host in getCorsFile', async ({ request }) => {
test('14 security: block 10.x host in getCorsFile', async ({ request }) => {
const encoded = b64('http://10.1.2.3/a.pdf');
const resp = await request.get(`/getCorsFile?urlPath=${encoded}`);
const body = await resp.text();