mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-03-18 23:23:46 +08:00
test(e2e): phase-2 add office and zip smoke coverage
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user