docs: 交付文档、维护指引与端到端回归
补齐 README、开发计划、维护交接与 E2E 用例,执行最终验收。
This commit is contained in:
1 parent
18732801b5
commit
6cd904d460
216 files changed
+37038
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { test, expect, createArticle, enableHelpCenter, setArticleStatus, unique } from '@e2e'
|
||||
|
||||
// Turning the help center on is an org-wide setting, so this runs in the serial
|
||||
// `org` project. The public site is unauthenticated: exactly what is published,
|
||||
// nothing else.
|
||||
|
||||
test('only published articles are on the public help center @help-center', async ({ adminApi, anonymousPage }) => {
|
||||
const site = await enableHelpCenter(adminApi)
|
||||
const code = unique('HC')
|
||||
const article = await createArticle(adminApi, {
|
||||
question: `How do I reset my router ${code}?`,
|
||||
answer: `Hold the reset button for ten seconds. Reference ${code}.`,
|
||||
})
|
||||
const articleUrl = `${site}/a/${article.slug}`
|
||||
|
||||
// A draft is invisible to the public: not listed, and its URL is not found.
|
||||
await anonymousPage.goto(site)
|
||||
await expect(anonymousPage.getByText(code)).toHaveCount(0)
|
||||
expect((await anonymousPage.request.get(articleUrl)).status()).toBe(404)
|
||||
|
||||
await setArticleStatus(adminApi, article.id, 'published')
|
||||
await anonymousPage.goto(articleUrl)
|
||||
await expect(anonymousPage.getByRole('heading', { name: `How do I reset my router ${code}?` })).toBeVisible()
|
||||
await expect(anonymousPage.getByText('Hold the reset button for ten seconds.')).toBeVisible()
|
||||
await anonymousPage.goto(site)
|
||||
await expect(anonymousPage.getByText(`How do I reset my router ${code}?`)).toBeVisible()
|
||||
|
||||
// Unpublishing takes it down again.
|
||||
await setArticleStatus(adminApi, article.id, 'draft')
|
||||
expect((await anonymousPage.request.get(articleUrl)).status()).toBe(404)
|
||||
})
|
||||
Reference in new issue
Block a user