Skip to content

Commit

Permalink
fix(docs): [anchor] 修复测试用例报错
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxi-20 authored and zzcr committed Nov 8, 2024
1 parent bf37865 commit 418c1d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/sites/demos/pc/app/anchor/change.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})

0 comments on commit 418c1d5

Please sign in to comment.