From 88b4d2aee200e658bcf15b6c5ebff437ca95f97a Mon Sep 17 00:00:00 2001 From: l Date: Sat, 11 May 2024 20:39:29 -0400 Subject: [PATCH] Added TDD --- cypress/e2e/03_features.cy.ts | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/03_features.cy.ts b/cypress/e2e/03_features.cy.ts index 3a9becb7c..f5f135560 100644 --- a/cypress/e2e/03_features.cy.ts +++ b/cypress/e2e/03_features.cy.ts @@ -110,7 +110,7 @@ describe('Get Features for Workspace', () => { cy.upsertlogin(User).then(value => { cy.request({ method: 'GET', - url: `${HostName}/features/forworkspace/` + Features[0].workspace_uuid, + url: `${HostName}/workspaces/${Features[0].workspace_uuid}/features`, //changed from url: `${HostName}/features/forworkspace/` + Features[0].workspace_uuid, please update the routes file and any other change needed. headers: { 'x-jwt': `${ value }` }, body: {} }).then((resp) => { @@ -132,7 +132,7 @@ describe('Get Feature by uuid', () => { for(let i = 0; i <= 2; i++) { cy.request({ method: 'GET', - url: `${HostName}/features/` + Features[i].uuid, + url: `${HostName}/features/`+ Features[i].uuid, headers: { 'x-jwt': `${ value }` }, body: {} }).then((resp) => { @@ -146,3 +146,33 @@ describe('Get Feature by uuid', () => { }) }) }) + +describe('Delete Feature by uuid', () => { + it('passes', () => { + cy.upsertlogin(User).then(value => { + cy.request({ + method: 'DELETE', + url: `${HostName}/features/${Features[0].uuid}`, + headers: { 'x-jwt': `${ value }` }, + body: {} + }).then((resp) => { + expect(resp.status).to.eq(200) + }) + }) + }) +}) + +describe('Check delete by uuid', () => { + it('passes', () => { + cy.upsertlogin(User).then(value => { + cy.request({ + method: 'GET', + url: `${HostName}/features/${Features[0].uuid}`, + headers: { 'x-jwt': `${ value }` }, + body: {} + }).then((resp) => { + expect(resp.status).to.eq(404); + }) + }) + }) +})