mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 12:52:31 +02:00
test: improve test coverage; properly test core client APIs (#6905)
* test: improve test coverage * fix
This commit is contained in:
parent
76cb012209
commit
d85cee576d
41 changed files with 1400 additions and 753 deletions
|
@ -92,13 +92,13 @@ function useVersionPersistence(): DocsVersionPersistence {
|
|||
return useThemeConfig().docs.versionPersistence;
|
||||
}
|
||||
|
||||
// Value that will be accessible through context: [state,api]
|
||||
// Value that will be accessible through context: [state,api]
|
||||
function useContextValue() {
|
||||
const allDocsData = useAllDocsData();
|
||||
const versionPersistence = useVersionPersistence();
|
||||
const pluginIds = useMemo(() => Object.keys(allDocsData), [allDocsData]);
|
||||
|
||||
// Initial state is empty, as we can't read browser storage in node/SSR
|
||||
// Initial state is empty, as we can't read browser storage in node/SSR
|
||||
const [state, setState] = useState(() => getInitialState(pluginIds));
|
||||
|
||||
// On mount, we set the state read from browser storage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue