Files
freeCodeCamp/cypress/integration/default/learn/common-components/helpButton.js
Ahmad Abdolsaheb 29e4a18a56 feat(tools): donation tests (#46633)
* feat: add stripe donate page test for non donors

* fix: revert changes to see if ev is passed correctly

* feat: download artifacts

* fix: add quotations for spec args with global patterns

* fix: remove firefox from cypress donation tests

* fix: trigger action on main push

* Apply suggestions from code review

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* feat: remove matrix and simplify

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2022-08-08 08:43:23 -07:00

37 lines
1.2 KiB
JavaScript

describe('Help Button', () => {
it('should be visible', () => {
cy.visit(
'/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements'
);
cy.get('#get-help-dropdown').scrollIntoView().should('be.visible');
});
it('should toggle the dropdown menu', () => {
cy.get('#get-help-dropdown').scrollIntoView().click();
cy.get('.tool-panel-group ul[role="menu"]')
.scrollIntoView()
.should('be.visible');
});
it('should render three links when video is available', () => {
cy.get('.tool-panel-group ul[role="menu"]').within(() => {
cy.get('a').should('have.length', 3);
cy.get('a').eq(0).contains('Get a Hint');
cy.get('a').eq(1).contains('Watch a Video');
cy.get('a').eq(2).contains('Ask for Help');
});
});
it('should render two links when video is not available', () => {
cy.visit(
'/learn/front-end-development-libraries/bootstrap/apply-the-default-bootstrap-button-style'
);
cy.get('#get-help-dropdown').scrollIntoView().click();
cy.get('.tool-panel-group ul[role="menu"]').within(() => {
cy.get('a').should('have.length', 2);
cy.get('a').eq(0).contains('Get a Hint');
cy.get('a').eq(1).contains('Ask for Help');
});
});
});