2019-10-05 23:38:38 +01:00
|
|
|
const selectors = {
|
|
|
|
challengeMap: "[data-test-label='learn-curriculum-map']"
|
|
|
|
};
|
|
|
|
|
|
|
|
const locations = {
|
|
|
|
index: '/learn'
|
|
|
|
};
|
|
|
|
|
|
|
|
const superBlockNames = [
|
2020-09-17 16:52:37 +06:00
|
|
|
'Responsive Web Design Certification',
|
|
|
|
'JavaScript Algorithms and Data Structures Certification',
|
2021-01-13 07:09:45 -06:00
|
|
|
'Front End Development Libraries Certification',
|
2020-09-17 16:52:37 +06:00
|
|
|
'Data Visualization Certification',
|
2021-08-14 03:57:13 +01:00
|
|
|
'Back End Development and APIs Certification',
|
2020-09-17 16:52:37 +06:00
|
|
|
'Quality Assurance Certification',
|
|
|
|
'Scientific Computing with Python Certification',
|
|
|
|
'Data Analysis with Python Certification',
|
|
|
|
'Information Security Certification',
|
|
|
|
'Machine Learning with Python Certification',
|
2022-02-10 07:39:12 -08:00
|
|
|
'Coding Interview Prep (Thousands of hours of challenges)',
|
2022-03-22 01:05:38 -05:00
|
|
|
'Responsive Web Design (Beta) Certification',
|
|
|
|
'Relational Database (Beta) Certification'
|
2019-10-05 23:38:38 +01:00
|
|
|
];
|
|
|
|
|
2020-09-17 16:52:37 +06:00
|
|
|
describe('Learn Landing page (not logged in)', () => {
|
|
|
|
it('Should render', () => {
|
2019-10-05 23:38:38 +01:00
|
|
|
cy.visit(locations.index);
|
|
|
|
|
2020-12-07 13:15:11 +03:00
|
|
|
cy.title().should(
|
|
|
|
'eq',
|
2021-01-15 17:39:59 +03:00
|
|
|
'Learn to Code — For Free — Coding Courses for Busy People'
|
2020-12-07 13:15:11 +03:00
|
|
|
);
|
2019-10-05 23:38:38 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it('Has the correct heading for an unauthenticated User', () => {
|
|
|
|
cy.visit(locations.index);
|
|
|
|
|
2020-08-13 16:03:03 +05:30
|
|
|
cy.contains('h1', "Welcome to freeCodeCamp's curriculum.");
|
2019-10-05 23:38:38 +01:00
|
|
|
});
|
|
|
|
|
2020-09-17 16:52:37 +06:00
|
|
|
it('Should render a curriculum map', () => {
|
2019-10-05 23:38:38 +01:00
|
|
|
cy.document().then(document => {
|
|
|
|
const superBlocks = document.querySelectorAll(
|
2020-12-28 20:52:41 -06:00
|
|
|
`${selectors.challengeMap} > li > a`
|
2019-10-05 23:38:38 +01:00
|
|
|
);
|
2022-02-18 10:29:30 -06:00
|
|
|
expect(superBlocks).to.have.length(13);
|
2019-10-05 23:38:38 +01:00
|
|
|
|
|
|
|
superBlocks.forEach((superBlock, idx) => {
|
|
|
|
expect(superBlock.innerText).to.have.string(superBlockNames[idx]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2020-09-17 16:52:37 +06:00
|
|
|
|
|
|
|
describe('Quotes', () => {
|
|
|
|
beforeEach(() => {
|
2021-06-24 12:50:36 +03:00
|
|
|
cy.login();
|
2020-09-17 16:52:37 +06:00
|
|
|
});
|
|
|
|
|
|
|
|
it('Should show a quote', () => {
|
|
|
|
cy.get('blockquote').within(() => {
|
|
|
|
cy.get('q').should('be.visible');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Should show quote author', () => {
|
|
|
|
cy.get('blockquote').within(() => {
|
|
|
|
cy.get('cite').should('be.visible');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Superblocks and Blocks', () => {
|
|
|
|
beforeEach(() => {
|
2021-06-24 12:50:36 +03:00
|
|
|
cy.login();
|
2020-09-17 16:52:37 +06:00
|
|
|
});
|
|
|
|
|
2021-01-13 07:09:45 -06:00
|
|
|
it('Has all superblocks visible', () => {
|
2020-09-17 16:52:37 +06:00
|
|
|
cy.wrap(superBlockNames.slice(1)).each(name => {
|
2020-12-28 20:52:41 -06:00
|
|
|
cy.contains(name).should('be.visible');
|
2020-09-17 16:52:37 +06:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|