Skip to content

Commit

Permalink
Merge pull request #126 from laylark/housekeeping/blog-cypress-tests
Browse files Browse the repository at this point in the history
Create cypress tests for blog spec
  • Loading branch information
zenlex authored Oct 25, 2022
2 parents 9d7985b + bf539e7 commit 4d634e4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cypress/e2e/blogSpec.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('Blogs', () => {
it('index route loads and shows blog card components', () => {
cy.visit('http://localhost:3000/blog');
cy.get('.post-list-item');
});

it('post route loads and displays a post', () => {
cy.visit('http://localhost:3000/blog');
cy.get('.post-list-item a').first().click();
cy.wait(5000);
cy.get('main');
});

it('index next and prev buttons work', () => {
cy.visit('http://localhost:3000/blog');
cy.get('.post-list-item a').first().click();
cy.wait(5000);
cy.get('a').contains('next post', {matchCase: false}).click();
cy.wait(5000);
cy.get('a').contains('previous post', {matchCase: false}).click();
cy.get('main');
});
});

0 comments on commit 4d634e4

Please sign in to comment.