docs: added tests for components in api-reference project (#14428)
* add tests (WIP) * added test for h2 * finished adding tests * fixes * fixes * fixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import React from "react"
|
||||
import { OpenAPI } from "types"
|
||||
import { ReactNode, createContext, useContext, useEffect, useMemo } from "react"
|
||||
import getTagChildSidebarItems from "../utils/get-tag-child-sidebar-items"
|
||||
@@ -68,7 +69,8 @@ const BaseSpecsProvider = ({ children, baseSpecs }: BaseSpecsProviderProps) => {
|
||||
children: childItems,
|
||||
loaded: childItems.length > 0,
|
||||
onOpen: () => {
|
||||
if (location.hash !== tagPathName) {
|
||||
const currentHash = location.hash.replace("#", "")
|
||||
if (currentHash !== tagPathName) {
|
||||
router.push(`#${tagPathName}`, {
|
||||
scroll: false,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user