mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
fix(docs): sidebar item label impact the pagination label of docs (#10025)
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
This commit is contained in:
parent
721f14537d
commit
e4ecffe418
2 changed files with 46 additions and 3 deletions
|
@ -719,6 +719,22 @@ describe('toDocNavigationLink', () => {
|
|||
} as PropNavigationLink);
|
||||
});
|
||||
|
||||
it('with sidebar item label', () => {
|
||||
expect(
|
||||
toDocNavigationLink(
|
||||
testDoc({
|
||||
title: 'Doc Title',
|
||||
permalink: '/docPermalink',
|
||||
frontMatter: {},
|
||||
}),
|
||||
{sidebarItemLabel: 'Doc sidebar item label'},
|
||||
),
|
||||
).toEqual({
|
||||
title: 'Doc sidebar item label',
|
||||
permalink: '/docPermalink',
|
||||
} as PropNavigationLink);
|
||||
});
|
||||
|
||||
it('with pagination_label + sidebar_label front matter', () => {
|
||||
expect(
|
||||
toDocNavigationLink(
|
||||
|
@ -736,6 +752,24 @@ describe('toDocNavigationLink', () => {
|
|||
permalink: '/docPermalink',
|
||||
} as PropNavigationLink);
|
||||
});
|
||||
|
||||
it('with sidebar_label + sidebar item label', () => {
|
||||
expect(
|
||||
toDocNavigationLink(
|
||||
testDoc({
|
||||
title: 'Doc Title',
|
||||
permalink: '/docPermalink',
|
||||
frontMatter: {
|
||||
sidebar_label: 'sidebar_label',
|
||||
},
|
||||
}),
|
||||
{sidebarItemLabel: 'Doc sidebar item label'},
|
||||
),
|
||||
).toEqual({
|
||||
title: 'sidebar_label',
|
||||
permalink: '/docPermalink',
|
||||
} as PropNavigationLink);
|
||||
});
|
||||
});
|
||||
|
||||
describe('toNavigationLink', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue