mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 17:17:28 +02:00
test: improve test coverage; multiple internal refactors (#6912)
This commit is contained in:
parent
12a7305238
commit
ad88f5cc87
78 changed files with 1613 additions and 1149 deletions
|
@ -58,22 +58,17 @@ function postProcessSidebarItem(
|
|||
`Sidebar category ${item.label} has neither any subitem nor a link. This makes this item not able to link to anything.`,
|
||||
);
|
||||
}
|
||||
switch (category.link.type) {
|
||||
case 'doc':
|
||||
return {
|
||||
return category.link.type === 'doc'
|
||||
? {
|
||||
type: 'doc',
|
||||
label: category.label,
|
||||
id: category.link.id,
|
||||
};
|
||||
case 'generated-index':
|
||||
return {
|
||||
}
|
||||
: {
|
||||
type: 'link',
|
||||
label: category.label,
|
||||
href: category.link.permalink,
|
||||
};
|
||||
default:
|
||||
throw new Error('Unexpected sidebar category link type');
|
||||
}
|
||||
}
|
||||
// A non-collapsible category can't be collapsed!
|
||||
if (category.collapsible === false) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue