2021-01-13 07:09:45 -06:00
|
|
|
const selectors = {
|
2021-02-11 12:22:04 -06:00
|
|
|
firstBlock: '.block-ui > .block:nth-child(1) > .map-title'
|
2021-01-13 07:09:45 -06:00
|
|
|
};
|
|
|
|
|
2021-06-04 19:04:02 +09:00
|
|
|
describe('Certification intro page', () => {
|
2021-01-13 07:09:45 -06:00
|
|
|
before(() => {
|
2022-03-31 10:34:40 -05:00
|
|
|
cy.exec('npm run seed');
|
2021-01-13 07:09:45 -06:00
|
|
|
cy.clearCookies();
|
|
|
|
cy.login();
|
|
|
|
cy.visit('/learn/responsive-web-design');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Should render', () => {
|
2021-06-04 19:04:02 +09:00
|
|
|
cy.title().should(
|
|
|
|
'eq',
|
|
|
|
'Responsive Web Design Certification | freeCodeCamp.org'
|
|
|
|
);
|
2021-01-13 07:09:45 -06:00
|
|
|
});
|
|
|
|
|
2021-06-04 19:04:02 +09:00
|
|
|
it('Should have certification intro text', () => {
|
2021-01-13 07:09:45 -06:00
|
|
|
cy.contains(
|
2021-01-21 00:14:57 +09:00
|
|
|
"In this Responsive Web Design Certification, you'll learn the languages that developers use to build webpages"
|
2021-01-13 07:09:45 -06:00
|
|
|
).should('be.visible');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('First block should be expanded', () => {
|
|
|
|
cy.contains('Say Hello to HTML Elements').should('be.visible');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Second block should be closed', () => {
|
|
|
|
cy.contains('Change the Color of Text').should('not.exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Block should handle toggle clicks correctly', () => {
|
|
|
|
cy.get(selectors.firstBlock).click();
|
|
|
|
cy.contains('Say Hello to HTML Elements').should('not.exist');
|
|
|
|
cy.get(selectors.firstBlock).click();
|
|
|
|
cy.contains('Say Hello to HTML Elements').should('be.visible');
|
|
|
|
});
|
|
|
|
});
|