Browse Source

test: use number with postgres tests since we are returning number value

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/6470/head
Pranav C 12 months ago
parent
commit
c3c4c1e929
  1. 12
      packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts
  2. 6
      packages/nocodb/tests/unit/rest/tests/tableRow.test.ts

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

@ -302,7 +302,6 @@ function generalDb() {
it('Nested List - Link to another record', async function () {
const expectedRecords = [1, 3, 1, 2];
const expectedRecordsPg = ['1', '3', '1', '2'];
// read first 4 records
const records = await ncAxiosGet({
@ -315,8 +314,7 @@ function generalDb() {
// extract LTAR column "City List"
const cityList = records.body.list.map((r) => r['Cities']);
if (isPg(context)) expect(cityList).to.deep.equal(expectedRecordsPg);
else expect(cityList).to.deep.equal(expectedRecords);
expect(cityList).to.deep.equal(expectedRecords);
});
it('Nested List - Lookup', async function () {
@ -360,7 +358,6 @@ function generalDb() {
});
const expectedRecords = [1, 3, 1, 2];
const expectedRecordsPg = ['1', '3', '1', '2'];
// read first 4 records
const records = await ncAxiosGet({
@ -373,11 +370,8 @@ function generalDb() {
// extract Lookup column
const rollupData = records.body.list.map((record) => record.Rollup);
if (isPg(context)) {
expect(rollupData).to.deep.equal(expectedRecordsPg);
} else {
expect(rollupData).to.deep.equal(expectedRecords);
}
expect(rollupData).to.deep.equal(expectedRecords);
});
it('Nested Read - Link to another record', async function () {

6
packages/nocodb/tests/unit/rest/tests/tableRow.test.ts

@ -301,11 +301,7 @@ function tableStaticTest() {
.expect(200);
const record = response.body;
if (isPg(context)) {
expect(record['Films']).to.equal('19');
} else {
expect(record['Films']).to.equal(19);
}
expect(record['Films']).to.equal(19);
});
it('Exist should be true table row when it exists', async function () {
const row = await getOneRow(context, {

Loading…
Cancel
Save