From d4dcdccb278f358bcab699ced62a655beeafb584 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 7 Oct 2022 20:09:02 +0530 Subject: [PATCH] test(api): key name correction Signed-off-by: Pranav C --- .../tests/unit/rest/tests/project.test.ts | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/tests/unit/rest/tests/project.test.ts b/packages/nocodb/tests/unit/rest/tests/project.test.ts index 0881d328a6..aa109f23ae 100644 --- a/packages/nocodb/tests/unit/rest/tests/project.test.ts +++ b/packages/nocodb/tests/unit/rest/tests/project.test.ts @@ -261,7 +261,7 @@ function projectTest() { .get(`/api/v1/db/meta/projects/${project.id}/audits`) .set('xc-auth', context.token) .send() - .expect(200); + .expect(200) }) @@ -276,13 +276,30 @@ function projectTest() { .send({}) .expect(200) .then(res => { - expect(res.body).to.have.all.keys('userCount', 'sharedBaseCount', 'projectCount','projects') + expect(res.body).to.have.all.keys( + 'userCount', + 'sharedBaseCount', + 'projectCount', + 'projects', + ) expect(res.body).to.have.property('projectCount').to.eq(1) expect(res.body).to.have.property('projects').to.be.an('array') expect(res.body.projects[0].tableCount.table).to.be.eq(3) expect(res.body).to.have.nested.property('projects[0].tableCount.table').to.be.a('number') expect(res.body).to.have.nested.property('projects[0].tableCount.view').to.be.a('number') - expect(res.body).to.have.nested.property('projects[0].viewCount').to.be.an('object').have.keys('formCount', 'gridCount', 'galleryCount', 'kanbanCount', 'total', 'sharedFormCount', 'sharedGridCount', 'sharedGalleryCount', 'sharedKanbanCount', 'sharedTotal', 'sharedPasswordProtected') + expect(res.body).to.have.nested.property('projects[0].viewCount').to.be.an('object') + .have.keys( + 'formCount', + 'gridCount', + 'galleryCount', + 'kanbanCount', + 'total', + 'sharedFormCount', + 'sharedGridCount', + 'sharedGalleryCount', + 'sharedKanbanCount', + 'sharedTotal', + 'sharedLockedCount') expect(res.body.projects[0]).have.keys( 'webhookCount', 'filterCount', @@ -290,7 +307,7 @@ function projectTest() { 'userCount', 'rowCount', 'tableCount', - 'viewCount' + 'viewCount', ) expect(res.body).to.have.nested.property('projects[0].rowCount').to.be.an('array') })