From 56aa0c9944d116efa0fd75f03d6ee8979ffe1e0d Mon Sep 17 00:00:00 2001 From: Pranav C <61551451+pranavxc@users.noreply.github.com> Date: Sun, 11 Jul 2021 18:54:00 +0530 Subject: [PATCH] test: correction in relation apis test Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com> --- packages/nocodb/package-lock.json | 5 +++++ packages/nocodb/src/__tests__/rest.test.ts | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index 2d9cb459ae..6fd94cf89d 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -8013,6 +8013,11 @@ } } }, + "graphql-type-json": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/graphql-type-json/-/graphql-type-json-0.3.2.tgz", + "integrity": "sha512-J+vjof74oMlCWXSvt0DOf2APEdZOCdubEvGDUAlqH//VBYcOYsGgRW7Xzorr44LvkjiuvecWc8fChxuZZbChtg==" + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", diff --git a/packages/nocodb/src/__tests__/rest.test.ts b/packages/nocodb/src/__tests__/rest.test.ts index 1b9862bd8b..44fe18602e 100644 --- a/packages/nocodb/src/__tests__/rest.test.ts +++ b/packages/nocodb/src/__tests__/rest.test.ts @@ -786,9 +786,9 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { expect(res.body).to.be.a('array'); expect(res.body[0]).to.be.a('object'); expect(res.body[0].country).to.be.a('string'); - expect(res.body[0].city).to.be.a('array'); - expect(res.body[0].city[0]).to.be.a('object'); - expect(res.body[0].city[0].city).to.be.a('string'); + expect(res.body[0].cityList).to.be.a('array'); + expect(res.body[0].cityList[0]).to.be.a('object'); + expect(res.body[0].cityList[0].city).to.be.a('string'); done(); }) }) @@ -914,7 +914,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { /**************** START : belongsTo ****************/ describe('City BelngsTo Country Api', function () { - it('has city - GET - /api/v1/country/has/city(:childs)?', function (done) { + it('city belongs to country - GET - /api/v1/city/belongs/country', function (done) { // get last inserted 5 entry by sorting db data in reverse order based on id request(app) .get(`/nc/${projectId}/api/v1/city/belongs/country?limit=10`) @@ -924,7 +924,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { expect(res.body).to.be.a('array'); expect(res.body[0]).to.be.a('object'); expect(res.body[0].city).to.be.a('string'); - expect(res.body[0].country).to.be.a('object'); + expect(res.body[0].countryRead).to.be.a('object'); expect(res.body.length).to.be.most(10) done(); })