From e7a4f5eeec837355c21498085ef057a736437953 Mon Sep 17 00:00:00 2001 From: Stanley Pierre-Louis Date: Fri, 10 Dec 2021 08:39:43 -0400 Subject: [PATCH] feat: add mock api cypress for one image tree --- cypress/tests/integration/trees/[treeid].cy.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cypress/tests/integration/trees/[treeid].cy.js b/cypress/tests/integration/trees/[treeid].cy.js index db81fa0b2..a5ad84776 100644 --- a/cypress/tests/integration/trees/[treeid].cy.js +++ b/cypress/tests/integration/trees/[treeid].cy.js @@ -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(); +});