Skip to content

Commit

Permalink
feat: add mock api cypress for one image tree
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelstan committed Dec 10, 2021
1 parent 7249b65 commit e7a4f5e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cypress/tests/integration/trees/[treeid].cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,22 @@ beforeEach(() => {
cy.task('clearNock');
});

// mocking api cypress for one(1) image tree.

const testImageTree = () => it('getServerSideProps returns mock', () => {
const path = `/trees/186734/`;
cy.intercept(path, { fixture: 'tree186734.json' });

cy.visit('/trees/186734');
cy.contains('186734');
});

describe('Image cases', () => {
imageFixtureNames.forEach(testImage);
testImage('gif', 'image/gif');
testImage('png', 'image/png');
});

describe('Image Tree case', () => {
testImageTree();
});

0 comments on commit e7a4f5e

Please sign in to comment.