Skip to content

Commit d84ed70

Browse files
committed
fix(docs): [anchor] 修复测试用例报错
1 parent 1a362ea commit d84ed70

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/sites/demos/pc/app/anchor/change.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ test('change事件', async ({ page }) => {
1111
const values = [] as string[]
1212
page.on('console', async (msg) => {
1313
for (const arg of msg.args()) {
14-
values.push(await arg.jsonValue())
14+
const text = await arg.jsonValue()
15+
if (text.includes('当前锚点')) {
16+
values.push(text)
17+
}
1518
}
1619
})
1720
await link1.click()
1821
await link2.click()
1922
expect(values.length).toBe(2)
20-
expect(values[0].startsWith('当前锚点')).toBeTruthy()
23+
expect(values[0].startsWith('当前锚点#basic-usage')).toBeTruthy()
2124
})

0 commit comments

Comments
 (0)