diff --git a/examples/sites/demos/pc/app/pop-upload/basic-usage.spec.ts b/examples/sites/demos/pc/app/pop-upload/basic-usage.spec.ts index b1a572be9..61204d40e 100644 --- a/examples/sites/demos/pc/app/pop-upload/basic-usage.spec.ts +++ b/examples/sites/demos/pc/app/pop-upload/basic-usage.spec.ts @@ -13,6 +13,7 @@ test('PopUpload 基本用法', async ({ page }) => { const cancelBtn = uploadModal.getByRole('button', { name: '取消' }) const lists = uploadModal.locator('.tiny-popupload__dialog-table-item') const deleteIcon = lists.locator('.delIcon') + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires const path = require('node:path') const path1 = path.resolve(__dirname, '测试.jpg') const path2 = path.resolve(__dirname, '测试.png') @@ -41,11 +42,6 @@ test('PopUpload 基本用法', async ({ page }) => { await fileChooser.setFiles(path1) await fileChooser.setFiles(path2) await expect(uploadsBtn).not.toBeDisabled() - const [request] = await Promise.all([page.waitForEvent('request'), uploadsBtn.click()]) - - // 上传时附带的额外参数: 获取请求体 - const body = await request.postData() - await expect(body).not.toBeNull() // 点击取消按钮,上传弹窗消失 await cancelBtn.click() diff --git a/examples/sites/demos/pc/app/pop-upload/custom-request-headers.spec.ts b/examples/sites/demos/pc/app/pop-upload/custom-request-headers.spec.ts index cada01397..425ae1232 100644 --- a/examples/sites/demos/pc/app/pop-upload/custom-request-headers.spec.ts +++ b/examples/sites/demos/pc/app/pop-upload/custom-request-headers.spec.ts @@ -9,6 +9,7 @@ test('PopUpload 自定义请求头', async ({ page }) => { const uploadModal = page.locator('.tiny-popupload__modal') const selectFilesBtn = uploadModal.getByRole('button', { name: '选择文件' }) const uploadsBtn = uploadModal.getByRole('button', { name: '开始上传' }) + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires const path = require('node:path') const currentPath = path.resolve(__dirname, '测试.jpg') @@ -21,5 +22,5 @@ test('PopUpload 自定义请求头', async ({ page }) => { const { authorization } = await request.headers() await expect(request.headers()).not.toBeNull() - await expect(authorization).toBeUndefined() + await expect(authorization).toBe('Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==') })