Browse Source

test: error message correction (3)

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5747/head
Raju Udava 1 year ago
parent
commit
6a1805e0f4
  1. 36
      packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts

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

@ -2270,7 +2270,8 @@ function linkBased() {
async function nestedAddTests(validParams, relationType?) {
// Link Add: Invalid table ID
if (debugMode) console.log('Link Add: Invalid table ID');
// if (debugMode)
console.log('Link Add: Invalid table ID');
await ncAxiosLinkAdd({
...validParams,
urlParams: { ...validParams.urlParams, tableId: 9999 },
@ -2279,7 +2280,8 @@ function linkBased() {
});
// Link Add: Invalid link ID
if (debugMode) console.log('Link Add: Invalid link ID');
// if (debugMode)
console.log('Link Add: Invalid link ID');
await ncAxiosLinkAdd({
...validParams,
urlParams: { ...validParams.urlParams, linkId: 9999 },
@ -2288,7 +2290,8 @@ function linkBased() {
});
// Link Add: Invalid Source row ID
if (debugMode) console.log('Link Add: Invalid Source row ID');
// if (debugMode)
console.log('Link Add: Invalid Source row ID');
await ncAxiosLinkAdd({
...validParams,
urlParams: { ...validParams.urlParams, rowId: 9999 },
@ -2300,7 +2303,7 @@ function linkBased() {
//
// Link Add: Invalid body parameter - empty body : ignore
if (debugMode)
// if (debugMode)
console.log('Link Add: Invalid body parameter - empty body : ignore');
await ncAxiosLinkAdd({
...validParams,
@ -2310,7 +2313,7 @@ function linkBased() {
if (relationType === 'bt') {
// Link Add: Invalid body parameter - row id invalid
if (debugMode)
// if (debugMode)
console.log('Link Add: Invalid body parameter - row id invalid');
await ncAxiosLinkAdd({
...validParams,
@ -2320,7 +2323,7 @@ function linkBased() {
});
} else {
// Link Add: Invalid body parameter - row id invalid
if (debugMode)
// if (debugMode)
console.log('Link Add: Invalid body parameter - row id invalid');
await ncAxiosLinkAdd({
...validParams,
@ -2330,20 +2333,21 @@ function linkBased() {
});
// Link Add: Invalid body parameter - repeated row id
if (debugMode)
// if (debugMode)
console.log('Link Add: Invalid body parameter - repeated row id');
await ncAxiosLinkAdd({
...validParams,
body: [1, 2, 1, 2],
status: 422,
msg: 'Child record with id [1, 2] contains duplicate value',
msg: 'Child record with id [1, 2] are duplicated',
});
}
}
async function nestedRemoveTests(validParams, relationType?) {
// Link Remove: Invalid table ID
if (debugMode) console.log('Link Remove: Invalid table ID');
// if (debugMode)
console.log('Link Remove: Invalid table ID');
await ncAxiosLinkRemove({
...validParams,
urlParams: { ...validParams.urlParams, tableId: 9999 },
@ -2352,7 +2356,8 @@ function linkBased() {
});
// Link Remove: Invalid link ID
if (debugMode) console.log('Link Remove: Invalid link ID');
// if (debugMode)
console.log('Link Remove: Invalid link ID');
await ncAxiosLinkRemove({
...validParams,
urlParams: { ...validParams.urlParams, linkId: 9999 },
@ -2361,7 +2366,8 @@ function linkBased() {
});
// Link Remove: Invalid Source row ID
if (debugMode) console.log('Link Remove: Invalid Source row ID');
// if (debugMode)
console.log('Link Remove: Invalid Source row ID');
await ncAxiosLinkRemove({
...validParams,
urlParams: { ...validParams.urlParams, rowId: 9999 },
@ -2373,7 +2379,7 @@ function linkBased() {
//
// Link Remove: Invalid body parameter - empty body : ignore
if (debugMode)
// if (debugMode)
console.log('Link Remove: Invalid body parameter - empty body : ignore');
await ncAxiosLinkRemove({
...validParams,
@ -2383,7 +2389,7 @@ function linkBased() {
if (relationType === 'bt') {
// Link Remove: Invalid body parameter - row id invalid
if (debugMode)
// if (debugMode)
console.log('Link Remove: Invalid body parameter - row id invalid');
await ncAxiosLinkRemove({
...validParams,
@ -2393,7 +2399,7 @@ function linkBased() {
});
} else {
// Link Remove: Invalid body parameter - row id invalid
if (debugMode)
// if (debugMode)
console.log('Link Remove: Invalid body parameter - row id invalid');
await ncAxiosLinkRemove({
...validParams,
@ -2403,7 +2409,7 @@ function linkBased() {
});
// Link Remove: Invalid body parameter - repeated row id
if (debugMode)
// if (debugMode)
console.log('Link Remove: Invalid body parameter - repeated row id');
await ncAxiosLinkRemove({
...validParams,

Loading…
Cancel
Save