mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 04:57:05 +02:00
feat:docs translation + versioning 💥
This commit is contained in:
parent
31d333b82f
commit
0f38ae3979
20 changed files with 1133 additions and 520 deletions
|
@ -1,35 +1,35 @@
|
|||
import createOrder from '@lib/load/docs/order';
|
||||
|
||||
describe('createOrder', () => {
|
||||
test('should populate docs index from multiple sidebars', () => {
|
||||
const result = createOrder({
|
||||
docs: {
|
||||
Category1: ['doc1', 'doc2'],
|
||||
Category2: ['doc3', 'doc4']
|
||||
},
|
||||
otherDocs: {
|
||||
Category1: ['doc5']
|
||||
}
|
||||
});
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should resolve docs from older versions', () => {
|
||||
const result = createOrder({
|
||||
docs: {
|
||||
Category1: ['doc1']
|
||||
},
|
||||
'version-1.2.3-docs': {
|
||||
Category1: ['version-1.2.3-doc2'],
|
||||
Category2: ['version-1.2.3-doc1']
|
||||
}
|
||||
});
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('edge cases', () => {
|
||||
expect(createOrder({})).toEqual({});
|
||||
expect(createOrder(null)).toEqual({});
|
||||
expect(createOrder(undefined)).toEqual({});
|
||||
});
|
||||
});
|
||||
import createOrder from '@lib/load/docs/order';
|
||||
|
||||
describe('createOrder', () => {
|
||||
test('should populate docs index from multiple sidebars', () => {
|
||||
const result = createOrder({
|
||||
docs: {
|
||||
Category1: ['doc1', 'doc2'],
|
||||
Category2: ['doc3', 'doc4']
|
||||
},
|
||||
otherDocs: {
|
||||
Category1: ['doc5']
|
||||
}
|
||||
});
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should resolve docs from older versions', () => {
|
||||
const result = createOrder({
|
||||
docs: {
|
||||
Category1: ['doc1']
|
||||
},
|
||||
'version-1.2.3-docs': {
|
||||
Category1: ['version-1.2.3-doc2'],
|
||||
Category2: ['version-1.2.3-doc1']
|
||||
}
|
||||
});
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('edge cases', () => {
|
||||
expect(createOrder({})).toEqual({});
|
||||
expect(createOrder(null)).toEqual({});
|
||||
expect(createOrder(undefined)).toEqual({});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue