mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-22 19:17:46 +02:00
test: docs ordering from sidebar
This commit is contained in:
parent
0365403a75
commit
4d10c3b8f3
2 changed files with 52 additions and 61 deletions
|
@ -11,7 +11,38 @@ describe('createOrder', () => {
|
|||
Category1: ['doc5']
|
||||
}
|
||||
});
|
||||
expect(result).toMatchSnapshot();
|
||||
expect(result).toEqual({
|
||||
doc1: {
|
||||
category: 'Category1',
|
||||
next: 'doc2',
|
||||
previous: undefined,
|
||||
sidebar: 'docs'
|
||||
},
|
||||
doc2: {
|
||||
category: 'Category1',
|
||||
next: 'doc3',
|
||||
previous: 'doc1',
|
||||
sidebar: 'docs'
|
||||
},
|
||||
doc3: {
|
||||
category: 'Category2',
|
||||
next: 'doc4',
|
||||
previous: 'doc2',
|
||||
sidebar: 'docs'
|
||||
},
|
||||
doc4: {
|
||||
category: 'Category2',
|
||||
next: undefined,
|
||||
previous: 'doc3',
|
||||
sidebar: 'docs'
|
||||
},
|
||||
doc5: {
|
||||
category: 'Category1',
|
||||
next: undefined,
|
||||
previous: undefined,
|
||||
sidebar: 'otherDocs'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('should resolve docs from older versions', () => {
|
||||
|
@ -24,7 +55,26 @@ describe('createOrder', () => {
|
|||
Category2: ['version-1.2.3-doc1']
|
||||
}
|
||||
});
|
||||
expect(result).toMatchSnapshot();
|
||||
expect(result).toEqual({
|
||||
doc1: {
|
||||
category: 'Category1',
|
||||
next: undefined,
|
||||
previous: undefined,
|
||||
sidebar: 'docs'
|
||||
},
|
||||
'version-1.2.3-doc1': {
|
||||
category: 'Category2',
|
||||
next: undefined,
|
||||
previous: 'version-1.2.3-doc2',
|
||||
sidebar: 'version-1.2.3-docs'
|
||||
},
|
||||
'version-1.2.3-doc2': {
|
||||
category: 'Category1',
|
||||
next: 'version-1.2.3-doc1',
|
||||
previous: undefined,
|
||||
sidebar: 'version-1.2.3-docs'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('edge cases', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue