Browse Source

test: error msg fix

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5747/head
Raju Udava 2 years ago
parent
commit
8a49da2712
  1. 22
      packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts

22
packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts

@ -513,7 +513,15 @@ function textBased() {
isLastPage: false, isLastPage: false,
}; };
expect(rsp.body.pageInfo).to.deep.equal(expectedPageInfo); expect(rsp.body.pageInfo).to.deep.equal(expectedPageInfo);
// verify if all the columns are present in the response
expect(verifyColumnsInRsp(rsp.body.list[0], columns)).to.equal(true); expect(verifyColumnsInRsp(rsp.body.list[0], columns)).to.equal(true);
// verify column data
const expectedData = insertedRecords.slice(0, 1);
expect(JSON.stringify(rsp.body.list[0])).to.deep.equal(
JSON.stringify(expectedData[0]),
);
}); });
it('List: offset, limit', async function () { it('List: offset, limit', async function () {
@ -883,6 +891,8 @@ function textBased() {
}); });
it('List: invalid sort, filter, fields', async function () { it('List: invalid sort, filter, fields', async function () {
// expect to ignore invalid sort, filter, fields
await ncAxiosGet({ await ncAxiosGet({
query: { query: {
sort: 'abc', sort: 'abc',
@ -2326,7 +2336,7 @@ function linkBased() {
...validParams, ...validParams,
body: [1, 2, 1, 2], body: [1, 2, 1, 2],
status: 422, status: 422,
msg: 'Child record with id [1, 2, 1, 2] contains duplicate value', msg: 'Child record with id [1, 2] contains duplicate value',
}); });
} }
} }
@ -2379,7 +2389,7 @@ function linkBased() {
...validParams, ...validParams,
body: [999, 998], body: [999, 998],
status: 422, status: 422,
msg: 'Child record with id [999, 998] invalid for belongs-to relation field. Should contain only one value', msg: 'Child record with id [999, 998] invalid. Belongs-to can link to only one record',
}); });
} else { } else {
// Link Remove: Invalid body parameter - row id invalid // Link Remove: Invalid body parameter - row id invalid
@ -2399,7 +2409,7 @@ function linkBased() {
...validParams, ...validParams,
body: [1, 2, 1, 2], body: [1, 2, 1, 2],
status: 422, status: 422,
msg: 'Child record with id [1, 2, 1, 2] contains duplicate value', msg: 'Child record with id [1, 2] contains duplicate value',
}); });
} }
} }
@ -2700,15 +2710,15 @@ function linkBased() {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
export default function () { export default function () {
// based out of sakila db, for link based tests
describe('General', generalDb);
// standalone tables // standalone tables
describe('Text based', textBased); describe('Text based', textBased);
describe('Numerical', numberBased); describe('Numerical', numberBased);
describe('Select based', selectBased); describe('Select based', selectBased);
describe('Date based', dateBased); describe('Date based', dateBased);
describe('Link based', linkBased); describe('Link based', linkBased);
// based out of sakila db, for link based tests
describe('General', generalDb);
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

Loading…
Cancel
Save