mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-19 19:22:28 +02:00
test: fix some type errors in test files (#7486)
This commit is contained in:
parent
624735bd92
commit
e2e40b8f5f
50 changed files with 319 additions and 182 deletions
|
@ -100,10 +100,13 @@ describe('createSidebarsUtils', () => {
|
|||
const sidebar4: Sidebar = [
|
||||
{
|
||||
type: 'category',
|
||||
collapsed: false,
|
||||
collapsible: true,
|
||||
label: 'Related',
|
||||
items: [
|
||||
{type: 'link', href: 'https://facebook.com'},
|
||||
{type: 'link', href: 'https://reactjs.org'},
|
||||
{type: 'link', href: 'https://docusaurus.io'},
|
||||
{type: 'link', href: 'https://facebook.com', label: 'Facebook'},
|
||||
{type: 'link', href: 'https://reactjs.org', label: 'React'},
|
||||
{type: 'link', href: 'https://docusaurus.io', label: 'Docusaurus'},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -696,10 +699,10 @@ describe('toNavigationLink', () => {
|
|||
|
||||
it('with doc items', () => {
|
||||
expect(toNavigationLink({type: 'doc', id: 'doc1'}, docsById)).toEqual(
|
||||
toDocNavigationLink(docsById.doc1),
|
||||
toDocNavigationLink(docsById.doc1!),
|
||||
);
|
||||
expect(toNavigationLink({type: 'doc', id: 'doc2'}, docsById)).toEqual(
|
||||
toDocNavigationLink(docsById.doc2),
|
||||
toDocNavigationLink(docsById.doc2!),
|
||||
);
|
||||
expect(() =>
|
||||
toNavigationLink({type: 'doc', id: 'doc3'}, docsById),
|
||||
|
@ -724,7 +727,7 @@ describe('toNavigationLink', () => {
|
|||
},
|
||||
docsById,
|
||||
),
|
||||
).toEqual(toDocNavigationLink(docsById.doc1));
|
||||
).toEqual(toDocNavigationLink(docsById.doc1!));
|
||||
expect(() =>
|
||||
toNavigationLink(
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue