diff --git a/client/plugins/fcc-source-challenges/create-challenge-nodes.js b/client/plugins/fcc-source-challenges/create-challenge-nodes.js index 21721d8466..da0afc0b5c 100644 --- a/client/plugins/fcc-source-challenges/create-challenge-nodes.js +++ b/client/plugins/fcc-source-challenges/create-challenge-nodes.js @@ -1,9 +1,11 @@ const crypto = require('crypto'); function createChallengeNode(challenge, reporter) { + // challengeType 11 is for video challenges (they only have instructions) + // challengeType 7 is for certificates (they only have tests) if ( typeof challenge.description[0] !== 'string' && - challenge.challengeType !== 11 + (challenge.challengeType !== 11 && challenge.challengeType !== 7) ) { reporter.warn(` @@ -17,7 +19,7 @@ function createChallengeNode(challenge, reporter) { .digest('hex'); const internal = { contentDigest, - type: 'ChallengeNode' + type: challenge.challengeType === 7 ? 'CertificateNode' : 'ChallengeNode' }; /* eslint-disable prefer-object-spread/prefer-object-spread */ @@ -26,13 +28,13 @@ function createChallengeNode(challenge, reporter) { Object.assign( {}, { - id: challenge.id + ' >>>> ChallengeNode', children: [], parent: null, internal, sourceInstanceName: 'challenge' }, - challenge + challenge, + { id: challenge.id + internal.type } ) ) ); diff --git a/client/plugins/fcc-source-challenges/gatsby-node.js b/client/plugins/fcc-source-challenges/gatsby-node.js index 9aa432d8fe..9425121ee3 100644 --- a/client/plugins/fcc-source-challenges/gatsby-node.js +++ b/client/plugins/fcc-source-challenges/gatsby-node.js @@ -69,7 +69,6 @@ File changed at ${filePath}, replacing challengeNode id ${challenge.id} } function createVisibleChallenge(challenge) { - if (challenge.superBlock.toLowerCase() === 'certificates') return; createNode(createChallengeNode(challenge, reporter)); } diff --git a/client/utils/gatsby/challengePageCreator.js b/client/utils/gatsby/challengePageCreator.js index 93afb092f9..ad37dfcca5 100644 --- a/client/utils/gatsby/challengePageCreator.js +++ b/client/utils/gatsby/challengePageCreator.js @@ -76,9 +76,6 @@ exports.createChallengePages = createPage => ({ node }, index, thisArray) => { } = node; // TODO: challengeType === 7 and isPrivate are the same, right? If so, we // should remove one of them. - if (challengeType === 7) { - return null; - } return createPage({ path: slug, diff --git a/cypress/integration/landing.js b/cypress/integration/landing.js index 48fcb8960d..61fde30781 100644 --- a/cypress/integration/landing.js +++ b/cypress/integration/landing.js @@ -7,6 +7,19 @@ const selectors = { landingPageImage: '.landing-page-image' }; +const certifications = [ + 'Responsive Web Design', + 'JavaScript Algorithms and Data Structures', + 'Front End Libraries', + 'Data Visualization', + 'APIs and Microservices', + 'Quality Assurance', + 'Scientific Computing with Python', + 'Data Analysis with Python', + 'Information Security', + 'Machine Learning with Python' +]; + describe('Landing page', () => { it('Should render', () => { cy.visit('/'); @@ -50,11 +63,14 @@ describe('Landing page', () => { .should('not.be.visible'); }); - it('Has 10 certifications', function() { + it('Has links to all the certifications', function() { cy.get(selectors.certifications) .children() .its('length') .should('eq', 10); + cy.wrap(certifications).each(cert => { + cy.get(selectors.certifications).contains(cert); + }); }); it('Has 3 testimonial cards', function() {