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:
Abdullah Saud 2024-04-11 21:26:11 +05:00 committed by GitHub
parent 721f14537d
commit e4ecffe418
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 3 deletions

View file

@ -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', () => {