Skip to content

Commit

Permalink
Track state of Organizations page (#1042)
Browse files Browse the repository at this point in the history
* Clean up header.spec.js

* Move footer.spec.js
  • Loading branch information
bruceplai committed Jan 30, 2022
1 parent e5eb4e0 commit 331942e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
File renamed without changes.
32 changes: 19 additions & 13 deletions cypress/integration/components/header.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
describe('Header component', () => {
const menuItems = {
joinIndex: ['Add Your Project', 'How to Add Your Project'],
overview: ['About', 'FAQ', 'Contact Us'],
collab: ['Collaborate with Us', 'Donate', 'Share the CTI', 'Volunteer with Us'],
orgs: ['All', 'Affiliated', 'Unaffiliated', 'Index Contributors'],
};

beforeEach(() => {
cy.visit('/home');
});
Expand All @@ -10,40 +17,39 @@ describe('Header component', () => {
.trigger('mouseover')
.get('[data-cy=menu-item]')
.within(() => {
cy.contains('Add Your Project').should('be.visible');
cy.contains('How to Add Your Project').should('be.visible');
menuItems.joinIndex.forEach((item) => {
cy.contains(item).should('be.visible');
});
});

cy.findLink('Overview')
.should('have.attr', 'href', '/home')
.trigger('mouseover')
.get('[data-cy=menu-item]')
.within(() => {
cy.contains('About').should('be.visible');
cy.contains('FAQ').should('be.visible');
cy.contains('Contact Us').should('be.visible');
menuItems.overview.forEach((item) => {
cy.contains(item).should('be.visible');
});
});

cy.findLink('Radical Collaboration')
.should('have.attr', 'href', '/home')
.trigger('mouseover')
.get('[data-cy=menu-item]')
.within(() => {
cy.contains('Collaborate with Us').should('be.visible');
cy.contains('Donate').should('be.visible');
cy.contains('Share the CTI').should('be.visible');
cy.contains('Volunteer with Us').should('be.visible');
menuItems.collab.forEach((item) => {
cy.contains(item).should('be.visible');
});
});

cy.findLink('Civic Tech Organizations')
.should('have.attr', 'href', '/home')
.trigger('mouseover')
.get('[data-cy=menu-item]')
.within(() => {
cy.contains('All').should('be.visible');
cy.contains('Affiliated').should('be.visible');
cy.contains('Unaffiliated').should('be.visible');
cy.contains('Index Contributors').should('be.visible');
menuItems.orgs.forEach((item) => {
cy.contains(item).should('be.visible');
});
});
});

Expand Down

0 comments on commit 331942e

Please sign in to comment.