fix: 票券打孔改 mask 差集——两端 1/4 圆硬停剪切,孔真穿透露底、描边真断开;孔心对齐撕线 172.75px

This commit is contained in:
cqh963852 committed 2026-10-06 13:38:16 +08:00
1 parent e83fde75f9
commit 789c8ac5bc
2 files changed
+25 -23

No files matched your search

+12 -6
View File
@@ -140,13 +140,19 @@ test.describe('票券规格契约', () => {
expect(s.headBg).not.toBe('rgba(0, 0, 0, 0)')
})
test('打孔伪元素在位(完成票 ×2 孔)', async ({ page }) => {
const holes = await page.locator('.ticket-pk').first().evaluate((el) => {
const b = getComputedStyle(el, '::before')
const a = getComputedStyle(el, '::after')
return [b.content, a.content].filter((c) => c !== 'none').length
test('打孔差集在位(mask 两端 1/4 圆,完成票)', async ({ page }) => {
const mask = await page.locator('.ticket-pk').first().evaluate((el) => {
const cs = getComputedStyle(el)
return cs.maskImage || cs.webkitMaskImage || 'none'
})
expect(holes).toBe(2)
expect(mask).toContain('radial-gradient')
expect(mask.split('radial-gradient').length - 1).toBe(2) // 上下各一孔
// 未开始票不带 mask
const plain = await page.evaluate(() => {
const t = [...document.querySelectorAll('div')].filter((d) => String(d.className).includes('w-[216px]') && !String(d.className).includes('ticket-pk'))[0]
return t ? getComputedStyle(t).maskImage : 'none'
})
expect(plain === 'none' || plain === '').toBeTruthy()
})
test('撕线:完成=虚线、未开始=实线', async ({ page }) => {