feat: i18n user interface (#40306)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Tom
2020-12-16 02:02:52 -06:00
committed by Mrugesh Mohapatra
parent a60a887e63
commit 3978c6be28
149 changed files with 3408 additions and 1084 deletions

View File

@ -2,7 +2,10 @@
import React from 'react';
import ShallowRenderer from 'react-test-renderer/shallow';
import renderer from 'react-test-renderer';
/* import { useTranslation } from 'react-i18next';
import { I18nextProvider } from 'react-i18next';
import i18n from '../../../i18n/configForTests';*/
import { UniversalNav } from './components/UniversalNav';
import { AuthOrProfile } from './components/NavLinks';
@ -30,7 +33,6 @@ describe('<NavLinks />', () => {
const shallow = new ShallowRenderer();
shallow.render(<AuthOrProfile {...landingPageProps} />);
const result = shallow.getRenderOutput();
expect(
hasForumNavItem(result) &&
hasCurriculumNavItem(result) &&
@ -112,16 +114,18 @@ const profileNavItem = component => component[2].children[0];
const hasForumNavItem = component => {
const { children, to } = navigationLinks(component, 0);
return children === 'Forum' && to === 'https://forum.freecodecamp.org';
return (
children === 'buttons.forum' && to === 'https://forum.freecodecamp.org'
);
};
const hasCurriculumNavItem = component => {
const { children, to } = navigationLinks(component, 1);
return children === 'Curriculum' && to === '/learn';
return children === 'buttons.curriculum' && to === '/learn';
};
const hasSignInButton = component =>
component.props.children[1].props.children === 'Sign In';
component.props.children[1].props.children === 'buttons.sign-in';
const avatarHasClass = (componentTree, classes) => {
// componentTree[1].children[0].children[1].props.className