зеркало из https://github.com/github/docs.git
REST Docs: update H3 to H2 operation heading (#27242)
* update H3 to H2 operation heading * update rest test to h2
This commit is contained in:
Родитель
1a4a46ddb3
Коммит
e087622e1f
|
@ -9,12 +9,12 @@ type Props = {
|
|||
export function RestOperationHeading({ slug, title, descriptionHTML }: Props) {
|
||||
return (
|
||||
<>
|
||||
<h3 id={slug}>
|
||||
<h2 id={slug}>
|
||||
<a href={`#${slug}`}>
|
||||
<LinkIcon size={16} className="m-1" />
|
||||
</a>
|
||||
{title}
|
||||
</h3>
|
||||
</h2>
|
||||
<div dangerouslySetInnerHTML={{ __html: descriptionHTML }} />
|
||||
</>
|
||||
)
|
||||
|
|
|
@ -9,17 +9,17 @@ import { getDiffOpenAPIContentRest } from '../../script/rest/test-open-api-schem
|
|||
describe('REST references docs', () => {
|
||||
jest.setTimeout(3 * 60 * 1000)
|
||||
|
||||
// Checks that every version of the /rest/references/checks
|
||||
// Checks that every version of the /rest/checks
|
||||
// page has every operation defined in the openapi schema.
|
||||
test('loads schema data for all versions', async () => {
|
||||
for (const version in allVersions) {
|
||||
const checksRestOperations = await getRest(version, 'checks', 'runs')
|
||||
const $ = await getDOM(`/en/${version}/rest/checks/runs`)
|
||||
const domH3Ids = $('h3')
|
||||
.map((i, h3) => $(h3).attr('id'))
|
||||
const domH2Ids = $('h2')
|
||||
.map((i, h2) => $(h2).attr('id'))
|
||||
.get()
|
||||
const schemaSlugs = checksRestOperations.map((operation) => slugger.slug(operation.title))
|
||||
expect(schemaSlugs.every((slug) => domH3Ids.includes(slug))).toBe(true)
|
||||
expect(schemaSlugs.every((slug) => domH2Ids.includes(slug))).toBe(true)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче