mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 00:27:21 +02:00
refactor(content-docs): deduplicate types, JSDoc for some APIs (#7027)
* refactor(content-docs): deduplicate types, JSDoc for some APIs * little refactor
This commit is contained in:
parent
b842197ac6
commit
2bcac29cd4
38 changed files with 715 additions and 521 deletions
|
@ -16,7 +16,10 @@ import {
|
|||
toNavigationLink,
|
||||
} from '../utils';
|
||||
import type {Sidebar, Sidebars} from '../types';
|
||||
import type {DocMetadataBase, DocNavLink} from '../../types';
|
||||
import type {
|
||||
DocMetadataBase,
|
||||
PropNavigationLink,
|
||||
} from '@docusaurus/plugin-content-docs';
|
||||
|
||||
describe('createSidebarsUtils', () => {
|
||||
const sidebar1: Sidebar = [
|
||||
|
@ -618,7 +621,7 @@ describe('toDocNavigationLink', () => {
|
|||
).toEqual({
|
||||
title: 'Doc Title',
|
||||
permalink: '/docPermalink',
|
||||
} as DocNavLink);
|
||||
} as PropNavigationLink);
|
||||
});
|
||||
|
||||
it('with pagination_label front matter', () => {
|
||||
|
@ -635,7 +638,7 @@ describe('toDocNavigationLink', () => {
|
|||
).toEqual({
|
||||
title: 'pagination_label',
|
||||
permalink: '/docPermalink',
|
||||
} as DocNavLink);
|
||||
} as PropNavigationLink);
|
||||
});
|
||||
|
||||
it('with sidebar_label front matter', () => {
|
||||
|
@ -652,7 +655,7 @@ describe('toDocNavigationLink', () => {
|
|||
).toEqual({
|
||||
title: 'sidebar_label',
|
||||
permalink: '/docPermalink',
|
||||
} as DocNavLink);
|
||||
} as PropNavigationLink);
|
||||
});
|
||||
|
||||
it('with pagination_label + sidebar_label front matter', () => {
|
||||
|
@ -670,7 +673,7 @@ describe('toDocNavigationLink', () => {
|
|||
).toEqual({
|
||||
title: 'pagination_label',
|
||||
permalink: '/docPermalink',
|
||||
} as DocNavLink);
|
||||
} as PropNavigationLink);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue