Browse Source

test: correction in relation apis test

Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
pull/341/head
Pranav C 3 years ago
parent
commit
56aa0c9944
  1. 5
      packages/nocodb/package-lock.json
  2. 10
      packages/nocodb/src/__tests__/rest.test.ts

5
packages/nocodb/package-lock.json generated

@ -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",

10
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();
})

Loading…
Cancel
Save