mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-04 11:52:39 +02:00
chore: prepare for docs sidebar
This commit is contained in:
parent
2141e6ea90
commit
b477863a30
9 changed files with 350 additions and 2 deletions
59
test/load/docs/__snapshots__/order.test.js.snap
Normal file
59
test/load/docs/__snapshots__/order.test.js.snap
Normal file
|
@ -0,0 +1,59 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`createOrder should populate docs index from multiple sidebars 1`] = `
|
||||
Object {
|
||||
"doc1": Object {
|
||||
"category": "Category1",
|
||||
"next": "doc2",
|
||||
"previous": undefined,
|
||||
"sidebar": "docs",
|
||||
},
|
||||
"doc2": Object {
|
||||
"category": "Category1",
|
||||
"next": "doc3",
|
||||
"previous": "doc1",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
"doc3": Object {
|
||||
"category": "Category2",
|
||||
"next": "doc4",
|
||||
"previous": "doc2",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
"doc4": Object {
|
||||
"category": "Category2",
|
||||
"next": undefined,
|
||||
"previous": "doc3",
|
||||
"sidebar": "docs",
|
||||
},
|
||||
"doc5": Object {
|
||||
"category": "Category1",
|
||||
"next": undefined,
|
||||
"previous": undefined,
|
||||
"sidebar": "otherDocs",
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`createOrder should resolve docs from older versions 1`] = `
|
||||
Object {
|
||||
"doc1": Object {
|
||||
"category": "Category1",
|
||||
"next": undefined,
|
||||
"previous": undefined,
|
||||
"sidebar": "docs",
|
||||
},
|
||||
"version-1.2.3-doc1": Object {
|
||||
"category": "Category2",
|
||||
"next": undefined,
|
||||
"previous": "version-1.2.3-doc2",
|
||||
"sidebar": "version-1.2.3-docs",
|
||||
},
|
||||
"version-1.2.3-doc2": Object {
|
||||
"category": "Category1",
|
||||
"next": "version-1.2.3-doc1",
|
||||
"previous": undefined,
|
||||
"sidebar": "version-1.2.3-docs",
|
||||
},
|
||||
}
|
||||
`;
|
45
test/load/docs/__snapshots__/sidebars.test.js.snap
Normal file
45
test/load/docs/__snapshots__/sidebars.test.js.snap
Normal file
|
@ -0,0 +1,45 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`loadSidebars normal site with sidebars 1`] = `
|
||||
Object {
|
||||
"docs": Object {
|
||||
"Getting Started": Array [
|
||||
"installation",
|
||||
],
|
||||
"Guides": Array [
|
||||
"blog",
|
||||
],
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`loadSidebars site with sidebars & versioned sidebars 1`] = `
|
||||
Object {
|
||||
"docs": Object {
|
||||
"Getting Started": Array [
|
||||
"installation",
|
||||
],
|
||||
"Guides": Array [
|
||||
"blog",
|
||||
],
|
||||
},
|
||||
"version-1.0.0-docs": Object {
|
||||
"Getting Started": Array [
|
||||
"version-1.0.0-installation",
|
||||
],
|
||||
"Guides": Array [
|
||||
"version-1.0.0-blog",
|
||||
],
|
||||
},
|
||||
"version-1.0.1-docs": Object {
|
||||
"Getting Started": Array [
|
||||
"version-1.0.1-installation",
|
||||
],
|
||||
"Guides": Array [
|
||||
"version-1.0.1-blog",
|
||||
],
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`loadSidebars site without sidebars 1`] = `Object {}`;
|
Loading…
Add table
Add a link
Reference in a new issue