-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Zach Badgett
committed
Apr 25, 2019
1 parent
dc3a94e
commit 372a1fe
Showing
6 changed files
with
488 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/docusaurus-1.x/lib/core/__tests__/__fixtures__/website/i18n/en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"_comment": "This file is auto-generated by write-translations.js", | ||
"localized-strings": { | ||
}, | ||
"pages-strings": { | ||
"Help Translate|recruit community translators for your project": "Help Us Translate", | ||
"Edit this Doc|recruitment message asking to edit the doc source": "Edit", | ||
"Translate this Doc|recruitment message asking to translate the docs": "Translate" | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
packages/docusaurus-1.x/lib/core/__tests__/__fixtures__/website/siteConfig.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* Copyright (c) 2017-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/* List of projects/orgs using your project for the users page */ | ||
|
||
const siteConfig = { | ||
title: 'Docusaurus', | ||
tagline: 'Easy to Maintain Open Source Documentation Websites', | ||
url: 'https://docusaurus.io', | ||
baseUrl: '/', | ||
organizationName: 'facebook', | ||
projectName: 'Docusaurus', | ||
cname: 'docusaurus.io', | ||
noIndex: false, | ||
editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/', | ||
headerLinks: [], | ||
headerIcon: 'img/docusaurus.svg', | ||
footerIcon: 'img/docusaurus_monochrome.svg', | ||
favicon: 'img/docusaurus.ico', | ||
algolia: { | ||
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c', | ||
indexName: 'docusaurus', | ||
algoliaOptions: { | ||
facetFilters: ['language:LANGUAGE', 'version:VERSION'], | ||
}, | ||
}, | ||
colors: { | ||
primaryColor: '#2E8555', | ||
secondaryColor: '#205C3B', | ||
}, | ||
translationRecruitingLink: 'https://crowdin.com/project/docusaurus', | ||
copyright: `Copyright © ${new Date().getFullYear()} Facebook Inc.`, | ||
usePrism: ['jsx'], | ||
highlight: { | ||
theme: 'atom-one-dark', | ||
}, | ||
scripts: [ | ||
'https://buttons.github.io/buttons.js', | ||
'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js', | ||
'/js/code-blocks-buttons.js', | ||
], | ||
gaTrackingId: 'UA-44373548-31', | ||
facebookAppId: '199138890728411', | ||
facebookComments: true, | ||
twitter: 'true', | ||
twitterUsername: 'docusaurus', | ||
ogImage: 'img/docusaurus.png', | ||
twitterImage: 'img/docusaurus.png', | ||
onPageNav: 'separate', | ||
cleanUrl: true, | ||
scrollToTop: true, | ||
scrollToTopOptions: { | ||
zIndex: 100, | ||
}, | ||
enableUpdateTime: true, | ||
enableUpdateBy: true, | ||
docsSideNavCollapsible: true, | ||
}; | ||
|
||
module.exports = siteConfig; |
93 changes: 93 additions & 0 deletions
93
packages/docusaurus-1.x/lib/core/__tests__/split-tab.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/** | ||
* Copyright (c) 2017-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @jest-environment jsdom | ||
*/ | ||
process.cwd = () => `${__dirname}/__fixtures__/website`; | ||
|
||
const React = require('react'); | ||
const {configure, mount} = require('enzyme'); | ||
const Adapter = require('enzyme-adapter-react-16'); | ||
const Doc = require('../Doc.js'); | ||
|
||
configure({adapter: new Adapter()}); | ||
|
||
describe('when code tabs are used correctly', () => { | ||
let props; | ||
let mountedDoc; | ||
const docPage = () => { | ||
if (!mountedDoc) { | ||
mountedDoc = mount(<Doc {...props} />); | ||
} | ||
return mountedDoc; | ||
}; | ||
beforeEach(() => { | ||
props = { | ||
content: ` | ||
<!--DOCUSAURUS_CODE_TABS--> | ||
<!--JavaScript--> | ||
\`\`\`js | ||
console.log('Hello, world!'); | ||
\`\`\` | ||
<!--Python--> | ||
\`\`\`py | ||
print('Hello, world!') | ||
\`\`\` | ||
<!--C--> | ||
\`\`\`C | ||
#include <stdio.h> | ||
int main() { | ||
printf("Hello World!"); | ||
return 0; | ||
} | ||
\`\`\` | ||
<!--Pascal--> | ||
\`\`\`Pascal | ||
program HelloWorld; | ||
begin | ||
WriteLn('Hello, world!'); | ||
end. | ||
\`\`\` | ||
<!--END_DOCUSAURUS_CODE_TABS--> | ||
`, | ||
metadata: {}, | ||
config: {}, | ||
}; | ||
mountedDoc = undefined; | ||
}); | ||
it('renders tabs correctly', () => { | ||
const node = docPage().getDOMNode(); | ||
const firstTab = node.querySelector('[data-tab$="-content-2"]').textContent; | ||
expect('JavaScript').toEqual(firstTab); | ||
const secondTab = node.querySelector('[data-tab$="-content-3"]') | ||
.textContent; | ||
expect('Python').toEqual(secondTab); | ||
const thirdTab = node.querySelector('[data-tab$="-content-4"]').textContent; | ||
expect('C').toEqual(thirdTab); | ||
const fourthTab = node.querySelector('[data-tab$="-content-5"]') | ||
.textContent; | ||
expect('Pascal').toEqual(fourthTab); | ||
}); | ||
it('renders content correctly', () => { | ||
const node = docPage().getDOMNode(); | ||
const firstContent = node.querySelector('[id$="-content-7"]').textContent; | ||
expect("console.log('Hello, world!');\n").toEqual(firstContent); | ||
const secondContent = node.querySelector('[id$="-content-8"]').textContent; | ||
expect("print('Hello, world!')\n").toEqual(secondContent); | ||
const thirdContent = node.querySelector('[id$="-content-9"]').textContent; | ||
expect( | ||
'#include <stdio.h>int main() { printf("Hello World!"); return 0;}\n', | ||
).toEqual(thirdContent); | ||
const fourthContent = node.querySelector('[id$="-content-10"]').textContent; | ||
expect("program HelloWorld;begin WriteLn('Hello, world!');end.\n").toEqual( | ||
fourthContent, | ||
); | ||
}); | ||
}); |
Oops, something went wrong.