Skip to content

Commit

Permalink
REST Docs: update H3 to H2 operation heading (github#27242)
Browse files Browse the repository at this point in the history
* update H3 to H2 operation heading

* update rest test to h2
  • Loading branch information
gracepark authored Apr 27, 2022
1 parent 1a4a46d commit e087622
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/rest/RestOperationHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }} />
</>
)
Expand Down
8 changes: 4 additions & 4 deletions tests/rendering/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})

Expand Down

0 comments on commit e087622

Please sign in to comment.