test(web): align install guidance expectations

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
This commit is contained in:
XiaoSeS 2026-09-04 12:34:09 +08:00
parent 7069e87e3b
commit 400240b5d6
2 changed files with 7 additions and 7 deletions

View file

@ -30,19 +30,21 @@ test.describe('Landing Quick Start CLI Tab (Real API)', () => {
await expect(page.getByText('npm i -g @astron-team/skillhub', { exact: true })).toBeVisible()
})
test('agent and human tabs keep their original commands', async ({ page }) => {
test('agent and human tabs expose the current SkillHub guidance', async ({ page }) => {
await page.goto('/')
const agentTab = page.getByRole('button', { name: 'I am Agent', exact: true })
const humanTab = page.getByRole('button', { name: 'I am Human', exact: true })
await expect(
page.getByText(/Read .+\/registry\/skill\.md and follow the instructions/),
page.getByText(/Connect SkillHub using .+\/install\/skillhub\.md/),
).toBeVisible()
await humanTab.click()
await expect(humanTab).toHaveAttribute('aria-pressed', 'true')
await expect(page.getByText('npx clawhub search <keyword>', { exact: true })).toBeVisible()
await expect(
page.getByText('npx @astron-team/skillhub@latest search <keyword>', { exact: true }),
).toBeVisible()
await agentTab.click()
await expect(agentTab).toHaveAttribute('aria-pressed', 'true')

View file

@ -51,12 +51,10 @@ test.describe('Public Skill Detail Anonymous Access (Real API)', () => {
const clawhubTarget = current.skill.namespace === 'global'
? current.skill.slug
: `${current.skill.namespace}--${current.skill.slug}`
const skillhubNamespace = current.skill.namespace === 'global'
? ''
: ` --namespace ${current.skill.namespace}`
const skillhubCoordinate = `@${current.skill.namespace}/${current.skill.slug}`
await expect(page.getByRole('tab', { name: 'SkillHub CLI' })).toHaveAttribute('aria-selected', 'true')
await expect(page.getByText(new RegExp(`npx @astron-team/skillhub@latest install ${escapeRegExp(current.skill.slug)}${escapeRegExp(skillhubNamespace)} --registry`))).toBeVisible()
await expect(page.getByText(new RegExp(`npx @astron-team/skillhub@latest install ${escapeRegExp(skillhubCoordinate)} --version ${escapeRegExp(current.skill.version)} --registry`))).toBeVisible()
await expect(page.getByRole('button', { name: 'Copy' }).first()).toBeVisible()
await page.getByRole('tab', { name: 'ClawHub CLI' }).click()