From 418c1d584c837fb4881673fb0b737d3ce69ead75 Mon Sep 17 00:00:00 2001 From: chenxi <2465950588@qq.com> Date: Thu, 7 Nov 2024 19:03:41 -0800 Subject: [PATCH] =?UTF-8?q?fix(docs):=20[anchor]=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/sites/demos/pc/app/anchor/change.spec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/sites/demos/pc/app/anchor/change.spec.ts b/examples/sites/demos/pc/app/anchor/change.spec.ts index e339b7fabb..2854c008b4 100644 --- a/examples/sites/demos/pc/app/anchor/change.spec.ts +++ b/examples/sites/demos/pc/app/anchor/change.spec.ts @@ -11,11 +11,14 @@ test('change事件', async ({ page }) => { const values = [] as string[] page.on('console', async (msg) => { for (const arg of msg.args()) { - values.push(await arg.jsonValue()) + const text = await arg.jsonValue() + if (text.includes('当前锚点')) { + values.push(text) + } } }) await link1.click() await link2.click() expect(values.length).toBe(2) - expect(values[0].startsWith('当前锚点')).toBeTruthy() + expect(values[0].startsWith('当前锚点#basic-usage')).toBeTruthy() })