mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-25 15:07:17 +02:00
feat(v2): headerlinks (#1074)
* feat(v2): headerlinks * fix test * nits * remove tictactoe: * headerIcon * nits * remove lang dropdown * fix failing test * search box * algolia search * use babel-eslint to resolve dynamic import * nits * favicon and title * Update .eslintignore
This commit is contained in:
parent
d4458b394c
commit
85336649d3
66 changed files with 1205 additions and 2292 deletions
|
@ -7,12 +7,12 @@
|
|||
|
||||
import path from 'path';
|
||||
import loadSidebars from '@lib/load/docs/sidebars';
|
||||
import loadSetup from '../../loadSetup';
|
||||
|
||||
describe('loadSidebars', () => {
|
||||
describe('loadSidebars', async () => {
|
||||
const fixtures = path.join(__dirname, '..', '__fixtures__');
|
||||
test('normal site with sidebars', () => {
|
||||
const env = {};
|
||||
const siteDir = path.join(fixtures, 'simple-site');
|
||||
test('normal site with sidebars', async () => {
|
||||
const {env, siteDir} = await loadSetup('simple');
|
||||
const result = loadSidebars({siteDir, env});
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
@ -24,26 +24,20 @@ describe('loadSidebars', () => {
|
|||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('site with sidebars & versioned sidebars', () => {
|
||||
const env = {
|
||||
versioning: {
|
||||
enabled: true,
|
||||
versions: ['1.0.1', '1.0.0'],
|
||||
},
|
||||
};
|
||||
const siteDir = path.join(fixtures, 'versioned-site');
|
||||
test('site with sidebars & versioned sidebars', async () => {
|
||||
const {env, siteDir} = await loadSetup('versioned');
|
||||
const result = loadSidebars({siteDir, env});
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('site with missing versioned sidebars', () => {
|
||||
test('site with missing versioned sidebars', async () => {
|
||||
const env = {
|
||||
versioning: {
|
||||
enabled: true,
|
||||
versions: ['2.0.0'],
|
||||
},
|
||||
};
|
||||
const siteDir = path.join(fixtures, 'versioned-site');
|
||||
const {siteDir} = await loadSetup('versioned');
|
||||
expect(() => {
|
||||
loadSidebars({siteDir, env});
|
||||
}).toThrowErrorMatchingInlineSnapshot(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue