From 32e2112caf0eaad4f053830b0d786b0b76c0c81d Mon Sep 17 00:00:00 2001 From: que01 Date: Thu, 8 Oct 2026 16:21:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=9F=E4=B8=80=E5=8F=8C=E7=AB=AF?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=9F=BA=E7=A1=80=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/taro/src/app.css | 10 ++++++++++ apps/taro/test/browser/preview.spec.ts | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/apps/taro/src/app.css b/apps/taro/src/app.css index fb6d891..3691b37 100644 --- a/apps/taro/src/app.css +++ b/apps/taro/src/app.css @@ -12,6 +12,16 @@ textarea, button { box-sizing: border-box; } +button { + margin: 0; + padding: 0; + border: 0; + border-radius: 0; + line-height: 1.5; + background: transparent; + color: inherit; + font: inherit; +} button::after { border: 0; } diff --git a/apps/taro/test/browser/preview.spec.ts b/apps/taro/test/browser/preview.spec.ts index 3044a88..0ab41f1 100644 --- a/apps/taro/test/browser/preview.spec.ts +++ b/apps/taro/test/browser/preview.spec.ts @@ -4,11 +4,21 @@ test("真实 API 驱动首页、出摊和主理人视觉槽位", async ({ page } page.on("pageerror", (error) => errors.push(error.message)); await page.goto("/"); await expect(page.locator(".food-home .name")).toContainText("阿成"); + await expect(page.locator(".food-home .actions button")).toHaveCount(2); const actionBounds = await page.locator(".food-home .actions button").evaluateAll((buttons) => { const parent = buttons[0].parentElement!.getBoundingClientRect(); return buttons.map((button) => button.getBoundingClientRect().right - parent.right); }); expect(Math.max(...actionBounds)).toBeLessThanOrEqual(1); + const actionStyles = await page + .locator(".food-home .actions button") + .first() + .evaluate((button) => { + const style = getComputedStyle(button); + return { margin: style.margin, borderWidth: style.borderWidth, padding: style.padding }; + }); + expect(actionStyles.margin).toBe("0px"); + expect(actionStyles.borderWidth).toBe("0px"); const widths = await page.locator(".scene").evaluate((element) => ({ image: element.getBoundingClientRect().width, parent: element.parentElement!.getBoundingClientRect().width,