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 1 year ago
parent
commit
c3c4c1e929
  1. 10
      packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts
  2. 4
      packages/nocodb/tests/unit/rest/tests/tableRow.test.ts

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

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

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

@ -301,11 +301,7 @@ function tableStaticTest() {
.expect(200); .expect(200);
const record = response.body; 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 () { it('Exist should be true table row when it exists', async function () {
const row = await getOneRow(context, { const row = await getOneRow(context, {

Loading…
Cancel
Save