mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-20 12:03:11 -04:00
fix: typos in names (#51896)
Co-authored-by: Viktor Szépe <viktor@szepe.net>
This commit is contained in:
@@ -98,7 +98,7 @@ const DesktopLayout = (props: DesktopLayoutProps): JSX.Element => {
|
||||
|
||||
const [showNotes, setShowNotes] = useState(false);
|
||||
const [showConsole, setShowConsole] = useState(false);
|
||||
const [showInstructions, setShowInstuctions] = useState(true);
|
||||
const [showInstructions, setShowInstructions] = useState(true);
|
||||
|
||||
const togglePane = (pane: string): void => {
|
||||
if (pane === 'showPreviewPane') {
|
||||
@@ -122,9 +122,9 @@ const DesktopLayout = (props: DesktopLayoutProps): JSX.Element => {
|
||||
} else if (pane === 'showNotes') {
|
||||
setShowNotes(!showNotes);
|
||||
} else if (pane === 'showInstructions') {
|
||||
setShowInstuctions(!showInstructions);
|
||||
setShowInstructions(!showInstructions);
|
||||
} else {
|
||||
setShowInstuctions(true);
|
||||
setShowInstructions(true);
|
||||
setShowConsole(false);
|
||||
setShowPreviewPane(true);
|
||||
setShowPreviewPortal(false);
|
||||
|
||||
@@ -355,15 +355,15 @@ class ShowExam extends Component<ShowExamProps, ShowExamState> {
|
||||
title: string;
|
||||
};
|
||||
|
||||
let missingPrequisites: Prerequisite[] = [];
|
||||
let missingPrerequisites: Prerequisite[] = [];
|
||||
if (prerequisites) {
|
||||
missingPrequisites = prerequisites?.filter(
|
||||
missingPrerequisites = prerequisites?.filter(
|
||||
prerequisite =>
|
||||
!completedChallenges.find(({ id }) => prerequisite.id === id)
|
||||
);
|
||||
}
|
||||
|
||||
const qualifiedForExam = missingPrequisites.length === 0;
|
||||
const qualifiedForExam = missingPrerequisites.length === 0;
|
||||
|
||||
const blockNameTitle = `${t(
|
||||
`intro:${superBlock}.blocks.${block}.title`
|
||||
@@ -539,7 +539,7 @@ class ShowExam extends Component<ShowExamProps, ShowExamState> {
|
||||
<p>{t('learn.exam.not-qualified')}</p>
|
||||
<Spacer size='small' />
|
||||
<ul>
|
||||
{missingPrequisites.map(({ title, id }) => (
|
||||
{missingPrerequisites.map(({ title, id }) => (
|
||||
<li key={id}>{title}</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
@@ -60,52 +60,52 @@ const challengePageContext = {
|
||||
test('Challenges should have DefaultLayout and no footer', () => {
|
||||
const challengePath =
|
||||
'/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements';
|
||||
const compnentObj = getComponentNameAndProps(
|
||||
const componentObj = getComponentNameAndProps(
|
||||
Learn,
|
||||
challengePath,
|
||||
challengePageContext
|
||||
);
|
||||
expect(compnentObj.name).toEqual('DefaultLayout');
|
||||
expect(compnentObj.props.showFooter).toEqual(false);
|
||||
expect(componentObj.name).toEqual('DefaultLayout');
|
||||
expect(componentObj.props.showFooter).toEqual(false);
|
||||
});
|
||||
|
||||
test('SuperBlock path should have DefaultLayout and footer', () => {
|
||||
const superBlockPath = '/learn/responsive-web-design/';
|
||||
const compnentObj = getComponentNameAndProps(Learn, superBlockPath);
|
||||
expect(compnentObj.name).toEqual('DefaultLayout');
|
||||
expect(compnentObj.props.showFooter).toEqual(true);
|
||||
const componentObj = getComponentNameAndProps(Learn, superBlockPath);
|
||||
expect(componentObj.name).toEqual('DefaultLayout');
|
||||
expect(componentObj.props.showFooter).toEqual(true);
|
||||
});
|
||||
|
||||
test('i18n challenge path should have DefaultLayout and no footer', () => {
|
||||
const challengePath =
|
||||
'espanol/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements/';
|
||||
const compnentObj = getComponentNameAndProps(
|
||||
const componentObj = getComponentNameAndProps(
|
||||
Learn,
|
||||
challengePath,
|
||||
challengePageContext
|
||||
);
|
||||
expect(compnentObj.name).toEqual('DefaultLayout');
|
||||
expect(compnentObj.props.showFooter).toEqual(false);
|
||||
expect(componentObj.name).toEqual('DefaultLayout');
|
||||
expect(componentObj.props.showFooter).toEqual(false);
|
||||
});
|
||||
|
||||
test('i18n superBlock path should have DefaultLayout and footer', () => {
|
||||
const superBlockPath = '/learn/responsive-web-design/';
|
||||
const compnentObj = getComponentNameAndProps(Learn, superBlockPath);
|
||||
expect(compnentObj.name).toEqual('DefaultLayout');
|
||||
expect(compnentObj.props.showFooter).toEqual(true);
|
||||
const componentObj = getComponentNameAndProps(Learn, superBlockPath);
|
||||
expect(componentObj.name).toEqual('DefaultLayout');
|
||||
expect(componentObj.props.showFooter).toEqual(true);
|
||||
});
|
||||
|
||||
test('404 page should have DefaultLayout and footer', () => {
|
||||
const challengePath =
|
||||
'/espanol/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements/';
|
||||
const compnentObj = getComponentNameAndProps(FourOhFourPage, challengePath);
|
||||
expect(compnentObj.name).toEqual('DefaultLayout');
|
||||
expect(compnentObj.props.showFooter).toEqual(true);
|
||||
const componentObj = getComponentNameAndProps(FourOhFourPage, challengePath);
|
||||
expect(componentObj.name).toEqual('DefaultLayout');
|
||||
expect(componentObj.props.showFooter).toEqual(true);
|
||||
});
|
||||
|
||||
test('Certification path should have CertificationLayout', () => {
|
||||
const challengePath =
|
||||
'/certification/mot01/javascript-algorithms-and-data-structures/';
|
||||
const compnentObj = getComponentNameAndProps(Certification, challengePath);
|
||||
expect(compnentObj.name).toEqual('CertificationLayout');
|
||||
const componentObj = getComponentNameAndProps(Certification, challengePath);
|
||||
expect(componentObj.name).toEqual('CertificationLayout');
|
||||
});
|
||||
|
||||
@@ -7,9 +7,9 @@ function plugin() {
|
||||
return transformer;
|
||||
|
||||
function transformer(tree, file) {
|
||||
const assigmentNodes = getAllBetween(tree, '--assignment--');
|
||||
const assignmentNodes = getAllBetween(tree, '--assignment--');
|
||||
|
||||
const assignment = getAssignments(assigmentNodes).filter(a => a != '');
|
||||
const assignment = getAssignments(assignmentNodes).filter(a => a != '');
|
||||
|
||||
file.data.assignments = assignment;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user