Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds some small tests for homepage #38

Merged
merged 6 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions cypress/integration/pages/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,24 @@ describe('Homepage', () => {

cy.get('h1').should('be.visible').should('contain', 'How much am I');
});

it('footer is visible', () => {
cy.visit('/');

cy.get('footer')
.should('be.visible')
.contains('F.A.Q.')
.should('have.attr', 'href', '/faq')
.click();

cy.url().should('contain', 'faq');
});

it('can click on a city', () => {
cy.visit('/');

cy.get('[data-cy-city=1]').click();

cy.url().should('match', /city\/\w+/);
});
});
1 change: 1 addition & 0 deletions src/components/RankingSection/RankingSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export function RankingSection(props: RankingSectionProps): React.ReactElement {
<div className="pt-2 w-full grid grid-flow-row grid-cols-1 grid-rows-5 md:grid-cols-2 md:grid-rows-3 gap-4">
{cities.map((city, index) => (
<Link
data-cy-city={index}
key={city.slug}
to={`/city/${city.slug}`}
onClick={(): void =>
Expand Down