From 8d13163e21e6150428bbf6fd9bfb0e7ae6d1fb82 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Thu, 10 Feb 2022 07:39:12 -0800 Subject: [PATCH] feat(tools): test file buttons (#44919) * feat(tools): test file buttons * fix: set SHOW_NEW_CURRICULUM to true * fix: landing test --- cypress/integration/landing.js | 5 +++-- cypress/integration/learn/challenges/multifile.js | 14 ++++++++++++++ cypress/integration/learn/index.js | 5 +++-- sample.env | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 cypress/integration/learn/challenges/multifile.js diff --git a/cypress/integration/landing.js b/cypress/integration/landing.js index b920c0d7c4..37a1de19dd 100644 --- a/cypress/integration/landing.js +++ b/cypress/integration/landing.js @@ -16,7 +16,8 @@ const certifications = [ 'Scientific Computing with Python', 'Data Analysis with Python', 'Information Security', - 'Machine Learning with Python' + 'Machine Learning with Python', + 'Responsive Web Design (Beta)' ]; describe('Landing page', () => { @@ -57,7 +58,7 @@ describe('Landing page', () => { }); it('Has links to all the certifications', function () { - cy.get(selectors.certifications).children().its('length').should('eq', 10); + cy.get(selectors.certifications).children().its('length').should('eq', 11); cy.wrap(certifications).each(cert => { cy.get(selectors.certifications).contains(cert); }); diff --git a/cypress/integration/learn/challenges/multifile.js b/cypress/integration/learn/challenges/multifile.js new file mode 100644 index 0000000000..05b174c06b --- /dev/null +++ b/cypress/integration/learn/challenges/multifile.js @@ -0,0 +1,14 @@ +const location = + '/learn/2022/responsive-web-design/learn-accessibility-by-building-a-quiz/step-2'; + +describe('Challenge with multifile editor', () => { + before(() => { + cy.visit(location); + }); + + it('renders the file tab buttons', () => { + cy.get('.monaco-editor-tabs').should('exist'); + cy.get('.monaco-editor-tabs').contains('index.html'); + cy.get('.monaco-editor-tabs').contains('styles.css'); + }); +}); diff --git a/cypress/integration/learn/index.js b/cypress/integration/learn/index.js index 05fb912a05..d819b66a5d 100644 --- a/cypress/integration/learn/index.js +++ b/cypress/integration/learn/index.js @@ -17,7 +17,8 @@ const superBlockNames = [ 'Data Analysis with Python Certification', 'Information Security Certification', 'Machine Learning with Python Certification', - 'Coding Interview Prep (Thousands of hours of challenges)' + 'Coding Interview Prep (Thousands of hours of challenges)', + 'Responsive Web Design (Beta) Certification' ]; describe('Learn Landing page (not logged in)', () => { @@ -41,7 +42,7 @@ describe('Learn Landing page (not logged in)', () => { const superBlocks = document.querySelectorAll( `${selectors.challengeMap} > li > a` ); - expect(superBlocks).to.have.length(11); + expect(superBlocks).to.have.length(12); superBlocks.forEach((superBlock, idx) => { expect(superBlock.innerText).to.have.string(superBlockNames[idx]); diff --git a/sample.env b/sample.env index b335f3e1d4..8737b7b644 100644 --- a/sample.env +++ b/sample.env @@ -57,7 +57,7 @@ CURRICULUM_LOCALE=english # Show or hide WIP in progress challenges SHOW_UPCOMING_CHANGES=false -SHOW_NEW_CURRICULUM=false +SHOW_NEW_CURRICULUM=true # Application paths HOME_LOCATION=http://localhost:8000