From a1af72a641eaaddc43231af3723ed72c8afec060 Mon Sep 17 00:00:00 2001 From: Menghuan1918 Date: Wed, 4 Nov 2026 21:18:08 +0800 Subject: [PATCH] =?UTF-8?q?test(e2e):=20=E5=BC=95=E7=94=A8=20chip=20?= =?UTF-8?q?=E7=9A=84=E5=8F=AF=E8=A7=81=E6=A0=87=E7=AD=BE=E6=98=AF=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E5=8C=96=E6=96=87=E6=A1=88=EF=BC=8C=E6=8C=89=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E6=96=AD=E8=A8=80=E8=80=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E5=86=92=E5=8F=B7=E5=88=86=E9=9A=94=EF=BC=88#1111=20=E5=90=8E?= =?UTF-8?q?=E7=BB=AD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/mount.e2e.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/e2e/mount.e2e.ts b/tests/e2e/mount.e2e.ts index f3c9227f..a88e6b04 100644 --- a/tests/e2e/mount.e2e.ts +++ b/tests/e2e/mount.e2e.ts @@ -610,9 +610,15 @@ test('plugin mounts into the DSH shell and survives a built-in tab sweep', async // `data-composer-chip` is the host's own anchor for a composer chip (its // JSDoc names e2e as the reason it exists) — a bare `[class*="reference"]` // match could land on any element whose hashed class happens to contain it. - const chip = page.locator(`[data-composer-chip]`).filter({ hasText: `${SEEDED_MD_FILE}:` }).first() + // + // The chip's VISIBLE label is the localized `quoteChip` string ("引用 …" / + // "Quote …") carrying the file name and line range; the compact `path:line` + // form is the chip's clipboard text, not its face (#1111). Match the file + // name, not the separator, and require exactly one chip so a duplicated + // insert still fails. + const chip = page.locator('[data-composer-chip]').filter({ hasText: SEEDED_MD_FILE }) await expect(chip, 'the selection must land in the composer as a reference chip') - .toBeVisible({ timeout: 10_000 }) + .toHaveCount(1, { timeout: 10_000 }) // A selection chip's `ref` is a fenced block, not a path: the host must not // mark it openable, or a click would hand that block to the file opener. await expect(chip, 'a selection chip must not advertise itself as openable')