From c98728ccd0619b62ec43bc31ba5c69384063253c Mon Sep 17 00:00:00 2001 From: "Nicholas Carrigan (he/him)" Date: Wed, 8 Dec 2021 12:29:16 -0800 Subject: [PATCH] feat(tools): test jQuery is defined (#44423) * feat(tools): test jQuery is defined * fix: add wait --- .../integration/learn/challenges/output.js | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/cypress/integration/learn/challenges/output.js b/cypress/integration/learn/challenges/output.js index 25b28fdce4..024b9d3c65 100644 --- a/cypress/integration/learn/challenges/output.js +++ b/cypress/integration/learn/challenges/output.js @@ -8,7 +8,10 @@ const selectors = { const locations = { index: '/learn/responsive-web-design/basic-html-and-html5/' + - 'say-hello-to-html-elements' + 'say-hello-to-html-elements', + jQuery: + '/learn/front-end-development-libraries/jquery/' + + 'target-html-elements-with-selectors-using-jquery' }; const defaultOutput = ` @@ -59,3 +62,25 @@ describe('Classic challenge', function () { }); }); }); + +describe('jQuery challenge', function () { + before(() => { + cy.visit(locations.jQuery); + }); + + it('renders the default output text', () => { + cy.title().should( + 'eq', + 'jQuery: Target HTML Elements with Selectors Using jQuery | freeCodeCamp.org' + ); + cy.get(selectors.defaultOutput).contains(defaultOutput); + }); + + it('should not show a reference error', () => { + cy.wait(5000); + cy.get(selectors.defaultOutput).should( + 'not.contain', + 'ReferenceError: $ is not defined' + ); + }); +});