feat(tools): test jQuery is defined (#44423)
* feat(tools): test jQuery is defined * fix: add wait
This commit is contained in:
committed by
GitHub
parent
4bdfb6794f
commit
c98728ccd0
@ -8,7 +8,10 @@ const selectors = {
|
|||||||
const locations = {
|
const locations = {
|
||||||
index:
|
index:
|
||||||
'/learn/responsive-web-design/basic-html-and-html5/' +
|
'/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 = `
|
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'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Reference in New Issue
Block a user