forked from opentiny/tiny-vue
docs(anchor): Fix test sheets, optimize anchor component documentation (#1239)
This commit is contained in:
parent
0d966ad6cc
commit
723b07d0ee
|
@ -19,29 +19,29 @@ const links = ref([
|
|||
{
|
||||
key: 'basic-usage',
|
||||
link: '#basic-usage',
|
||||
title: 'Basic Usage'
|
||||
title: '基本用法'
|
||||
},
|
||||
{
|
||||
key: 'is-affix',
|
||||
link: '#is-affix',
|
||||
title: 'Is Affix'
|
||||
title: '固定模式'
|
||||
},
|
||||
{
|
||||
key: 'set-container',
|
||||
link: '#set-container',
|
||||
title: 'Set Container'
|
||||
title: '滚动容器'
|
||||
},
|
||||
{
|
||||
key: 'on-change',
|
||||
link: '#on-change',
|
||||
title: 'On Change'
|
||||
link: '#change',
|
||||
title: 'change 事件'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'api',
|
||||
link: '#api',
|
||||
title: 'Api'
|
||||
link: '#API',
|
||||
title: 'API'
|
||||
}
|
||||
])
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ test('基本用法', async ({ page }) => {
|
|||
|
||||
const anchor = page.locator('.tiny-anchor')
|
||||
const link1 = anchor.getByRole('link', { name: '演示' })
|
||||
const link2 = anchor.getByRole('link', { name: 'On Change' })
|
||||
const link2 = anchor.getByRole('link', { name: 'change 事件' })
|
||||
const hash1 = await page.evaluate(() => window.location.hash)
|
||||
|
||||
await link1.click()
|
||||
|
@ -18,5 +18,5 @@ test('基本用法', async ({ page }) => {
|
|||
await link2.click()
|
||||
const hash3 = await page.evaluate(() => window.location.hash)
|
||||
|
||||
await expect(hash3).toContain('#on-change')
|
||||
await expect(hash3).toContain('#change')
|
||||
})
|
||||
|
|
|
@ -27,29 +27,29 @@ export default {
|
|||
{
|
||||
key: 'basic-usage',
|
||||
link: '#basic-usage',
|
||||
title: 'Basic Usage'
|
||||
title: '基本用法'
|
||||
},
|
||||
{
|
||||
key: 'is-affix',
|
||||
link: '#is-affix',
|
||||
title: 'Is Affix'
|
||||
title: '固定模式'
|
||||
},
|
||||
{
|
||||
key: 'set-container',
|
||||
link: '#set-container',
|
||||
title: 'Set Container'
|
||||
title: '滚动容器'
|
||||
},
|
||||
{
|
||||
key: 'on-change',
|
||||
link: '#on-change',
|
||||
title: 'On Change'
|
||||
link: '#change',
|
||||
title: 'change 事件'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'api',
|
||||
link: '#api',
|
||||
title: 'Api'
|
||||
link: '#API',
|
||||
title: 'API'
|
||||
}
|
||||
],
|
||||
type: 'dot'
|
||||
|
|
|
@ -15,29 +15,29 @@ const links = ref([
|
|||
{
|
||||
key: 'basic-usage',
|
||||
link: '#basic-usage',
|
||||
title: 'Basic Usage'
|
||||
title: '基本用法'
|
||||
},
|
||||
{
|
||||
key: 'is-affix',
|
||||
link: '#is-affix',
|
||||
title: 'Is Affix'
|
||||
title: '固定模式'
|
||||
},
|
||||
{
|
||||
key: 'set-container',
|
||||
link: '#set-container',
|
||||
title: 'Set Container'
|
||||
title: '滚动容器'
|
||||
},
|
||||
{
|
||||
key: 'on-change',
|
||||
link: '#on-change',
|
||||
title: 'On Change'
|
||||
link: '#change',
|
||||
title: 'change 事件'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'api',
|
||||
link: '#api',
|
||||
title: 'Api'
|
||||
link: '#API',
|
||||
title: 'API'
|
||||
}
|
||||
])
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@ test('change事件', async ({ page }) => {
|
|||
|
||||
const anchor = page.locator('.tiny-anchor')
|
||||
const link1 = anchor.getByRole('link', { name: '演示' })
|
||||
const link2 = anchor.getByRole('link', { name: 'On Change' })
|
||||
const link2 = anchor.getByRole('link', { name: 'change 事件' })
|
||||
const modal = page.locator('.tiny-modal')
|
||||
|
||||
await link1.click()
|
||||
await expect(modal).toHaveCount(1)
|
||||
await link2.click()
|
||||
await expect(modal).toHaveCount(2)
|
||||
await expect(modal.last()).toHaveText(/#on-change/)
|
||||
await expect(modal.last()).toHaveText(/#change/)
|
||||
})
|
||||
|
|
|
@ -20,29 +20,29 @@ export default {
|
|||
{
|
||||
key: 'basic-usage',
|
||||
link: '#basic-usage',
|
||||
title: 'Basic Usage'
|
||||
title: '基本用法'
|
||||
},
|
||||
{
|
||||
key: 'is-affix',
|
||||
link: '#is-affix',
|
||||
title: 'Is Affix'
|
||||
title: '固定模式'
|
||||
},
|
||||
{
|
||||
key: 'set-container',
|
||||
link: '#set-container',
|
||||
title: 'Set Container'
|
||||
title: '滚动容器'
|
||||
},
|
||||
{
|
||||
key: 'on-change',
|
||||
link: '#on-change',
|
||||
title: 'On Change'
|
||||
link: '#change',
|
||||
title: 'change 事件'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'api',
|
||||
link: '#api',
|
||||
title: 'Api'
|
||||
link: '#API',
|
||||
title: 'API'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -22,29 +22,29 @@ const links = ref([
|
|||
{
|
||||
key: 'basic-usage',
|
||||
link: '#basic-usage',
|
||||
title: 'Basic Usage'
|
||||
title: '基本用法'
|
||||
},
|
||||
{
|
||||
key: 'is-affix',
|
||||
link: '#is-affix',
|
||||
title: 'Is Affix'
|
||||
title: '固定模式'
|
||||
},
|
||||
{
|
||||
key: 'set-container',
|
||||
link: '#set-container',
|
||||
title: 'Set Container'
|
||||
title: '滚动容器'
|
||||
},
|
||||
{
|
||||
key: 'on-change',
|
||||
link: '#on-change',
|
||||
title: 'On Change'
|
||||
link: '#change',
|
||||
title: 'change 事件'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'api',
|
||||
link: '#api',
|
||||
title: 'Api'
|
||||
link: '#API',
|
||||
title: 'API'
|
||||
}
|
||||
])
|
||||
</script>
|
||||
|
|
|
@ -28,29 +28,29 @@ export default {
|
|||
{
|
||||
key: 'basic-usage',
|
||||
link: '#basic-usage',
|
||||
title: 'Basic Usage'
|
||||
title: '基本用法'
|
||||
},
|
||||
{
|
||||
key: 'is-affix',
|
||||
link: '#is-affix',
|
||||
title: 'Is Affix'
|
||||
title: '固定模式'
|
||||
},
|
||||
{
|
||||
key: 'set-container',
|
||||
link: '#set-container',
|
||||
title: 'Set Container'
|
||||
title: '滚动容器'
|
||||
},
|
||||
{
|
||||
key: 'on-change',
|
||||
link: '#on-change',
|
||||
title: 'On Change'
|
||||
link: '#change',
|
||||
title: 'change 事件'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'api',
|
||||
link: '#api',
|
||||
title: 'Api'
|
||||
link: '#API',
|
||||
title: 'API'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -11,29 +11,29 @@ const links = reactive([
|
|||
{
|
||||
key: 'basic-usage',
|
||||
link: '#basic-usage',
|
||||
title: 'Basic Usage'
|
||||
title: '基本用法'
|
||||
},
|
||||
{
|
||||
key: 'is-affix',
|
||||
link: '#is-affix',
|
||||
title: 'Is Affix'
|
||||
title: '固定模式'
|
||||
},
|
||||
{
|
||||
key: 'set-container',
|
||||
link: '#set-container',
|
||||
title: 'Set Container'
|
||||
title: '滚动容器'
|
||||
},
|
||||
{
|
||||
key: 'on-change',
|
||||
link: '#on-change',
|
||||
title: 'On Change'
|
||||
link: '#change',
|
||||
title: 'change 事件'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'api',
|
||||
link: '#api',
|
||||
title: 'Api'
|
||||
link: '#API',
|
||||
title: 'API'
|
||||
}
|
||||
])
|
||||
|
||||
|
|
Loading…
Reference in New Issue