fix(learn): split and simplified learn map (#39154)

This commit is contained in:
Kabindra Shrestha
2020-12-28 20:52:41 -06:00
committed by Mrugesh Mohapatra
parent 48c97238fc
commit ac3d762bb5
25 changed files with 694 additions and 963 deletions

View File

@ -41,7 +41,7 @@ describe('Learn Landing page (not logged in)', () => {
it('Should render a curriculum map', () => {
cy.document().then(document => {
const superBlocks = document.querySelectorAll(
`${selectors.challengeMap} > ul > li`
`${selectors.challengeMap} > li > a`
);
expect(superBlocks).to.have.length(11);
@ -77,44 +77,9 @@ describe('Superblocks and Blocks', () => {
cy.contains("Get started (it's free)").click();
});
it('Has first superblock and block collapsed by default', () => {
cy.contains(superBlockNames[0])
.should('be.visible')
.and('have.attr', 'aria-expanded', 'true');
cy.contains('Basic HTML and HTML5')
.should('be.visible')
.and('have.attr', 'aria-expanded', 'true');
});
it('Has all supeblocks visible but folded (excluding the first one)', () => {
it('Has all supeblocks visible', () => {
cy.wrap(superBlockNames.slice(1)).each(name => {
cy.contains(name)
.should('be.visible')
.and('have.attr', 'aria-expanded', 'false');
cy.contains(name).should('be.visible');
});
});
it('Superblocks should be collapsable and foldable', () => {
cy.contains(superBlockNames[0])
.click()
.should('have.attr', 'aria-expanded', 'false');
cy.contains('Basic HTML and HTML5').should('not.exist');
cy.contains(superBlockNames[0])
.click()
.should('have.attr', 'aria-expanded', 'true');
cy.contains('Basic HTML and HTML5').should('be.visible');
});
it('Blocks should be collapsable and foldable', () => {
cy.contains('Basic HTML and HTML5')
.click()
.should('have.attr', 'aria-expanded', 'false');
cy.contains('Introduction to Basic HTML and HTML5').should('not.exist');
cy.contains('Basic HTML and HTML5')
.click()
.should('have.attr', 'aria-expanded', 'true');
cy.contains('Introduction to Basic HTML and HTML5').should('be.visible');
});
});