|
|
@ -2270,8 +2270,7 @@ function linkBased() { |
|
|
|
|
|
|
|
|
|
|
|
async function nestedAddTests(validParams, relationType?) { |
|
|
|
async function nestedAddTests(validParams, relationType?) { |
|
|
|
// Link Add: Invalid table ID
|
|
|
|
// Link Add: Invalid table ID
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) console.log('Link Add: Invalid table ID'); |
|
|
|
console.log('Link Add: Invalid table ID'); |
|
|
|
|
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
|
urlParams: { ...validParams.urlParams, tableId: 9999 }, |
|
|
|
urlParams: { ...validParams.urlParams, tableId: 9999 }, |
|
|
@ -2280,8 +2279,7 @@ function linkBased() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Link Add: Invalid link ID
|
|
|
|
// Link Add: Invalid link ID
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) console.log('Link Add: Invalid link ID'); |
|
|
|
console.log('Link Add: Invalid link ID'); |
|
|
|
|
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
|
urlParams: { ...validParams.urlParams, linkId: 9999 }, |
|
|
|
urlParams: { ...validParams.urlParams, linkId: 9999 }, |
|
|
@ -2290,8 +2288,7 @@ function linkBased() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Link Add: Invalid Source row ID
|
|
|
|
// Link Add: Invalid Source row ID
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) console.log('Link Add: Invalid Source row ID'); |
|
|
|
console.log('Link Add: Invalid Source row ID'); |
|
|
|
|
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
|
urlParams: { ...validParams.urlParams, rowId: 9999 }, |
|
|
|
urlParams: { ...validParams.urlParams, rowId: 9999 }, |
|
|
@ -2303,7 +2300,7 @@ function linkBased() { |
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
// Link Add: Invalid body parameter - empty body : ignore
|
|
|
|
// Link Add: Invalid body parameter - empty body : ignore
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) |
|
|
|
console.log('Link Add: Invalid body parameter - empty body : ignore'); |
|
|
|
console.log('Link Add: Invalid body parameter - empty body : ignore'); |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
@ -2313,17 +2310,17 @@ function linkBased() { |
|
|
|
|
|
|
|
|
|
|
|
if (relationType === 'bt') { |
|
|
|
if (relationType === 'bt') { |
|
|
|
// Link Add: Invalid body parameter - row id invalid
|
|
|
|
// Link Add: Invalid body parameter - row id invalid
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) |
|
|
|
console.log('Link Add: Invalid body parameter - row id invalid'); |
|
|
|
console.log('Link Add: Invalid body parameter - row id invalid'); |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
...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] not found', |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Link Add: Invalid body parameter - row id invalid
|
|
|
|
// Link Add: Invalid body parameter - row id invalid
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) |
|
|
|
console.log('Link Add: Invalid body parameter - row id invalid'); |
|
|
|
console.log('Link Add: Invalid body parameter - row id invalid'); |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
@ -2333,7 +2330,7 @@ function linkBased() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Link Add: Invalid body parameter - repeated row id
|
|
|
|
// Link Add: Invalid body parameter - repeated row id
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) |
|
|
|
console.log('Link Add: Invalid body parameter - repeated row id'); |
|
|
|
console.log('Link Add: Invalid body parameter - repeated row id'); |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
await ncAxiosLinkAdd({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
@ -2346,8 +2343,7 @@ function linkBased() { |
|
|
|
|
|
|
|
|
|
|
|
async function nestedRemoveTests(validParams, relationType?) { |
|
|
|
async function nestedRemoveTests(validParams, relationType?) { |
|
|
|
// Link Remove: Invalid table ID
|
|
|
|
// Link Remove: Invalid table ID
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) console.log('Link Remove: Invalid table ID'); |
|
|
|
console.log('Link Remove: Invalid table ID'); |
|
|
|
|
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
|
urlParams: { ...validParams.urlParams, tableId: 9999 }, |
|
|
|
urlParams: { ...validParams.urlParams, tableId: 9999 }, |
|
|
@ -2356,8 +2352,7 @@ function linkBased() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Link Remove: Invalid link ID
|
|
|
|
// Link Remove: Invalid link ID
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) console.log('Link Remove: Invalid link ID'); |
|
|
|
console.log('Link Remove: Invalid link ID'); |
|
|
|
|
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
|
urlParams: { ...validParams.urlParams, linkId: 9999 }, |
|
|
|
urlParams: { ...validParams.urlParams, linkId: 9999 }, |
|
|
@ -2366,8 +2361,7 @@ function linkBased() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Link Remove: Invalid Source row ID
|
|
|
|
// Link Remove: Invalid Source row ID
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) console.log('Link Remove: Invalid Source row ID'); |
|
|
|
console.log('Link Remove: Invalid Source row ID'); |
|
|
|
|
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
|
urlParams: { ...validParams.urlParams, rowId: 9999 }, |
|
|
|
urlParams: { ...validParams.urlParams, rowId: 9999 }, |
|
|
@ -2379,7 +2373,7 @@ function linkBased() { |
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
// Link Remove: Invalid body parameter - empty body : ignore
|
|
|
|
// Link Remove: Invalid body parameter - empty body : ignore
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) |
|
|
|
console.log('Link Remove: Invalid body parameter - empty body : ignore'); |
|
|
|
console.log('Link Remove: Invalid body parameter - empty body : ignore'); |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
@ -2389,17 +2383,17 @@ function linkBased() { |
|
|
|
|
|
|
|
|
|
|
|
if (relationType === 'bt') { |
|
|
|
if (relationType === 'bt') { |
|
|
|
// Link Remove: Invalid body parameter - row id invalid
|
|
|
|
// Link Remove: Invalid body parameter - row id invalid
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) |
|
|
|
console.log('Link Remove: Invalid body parameter - row id invalid'); |
|
|
|
console.log('Link Remove: Invalid body parameter - row id invalid'); |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
|
body: [999, 998], |
|
|
|
body: [999, 998], |
|
|
|
status: 422, |
|
|
|
status: 422, |
|
|
|
msg: 'Child record with id [999, 998] invalid. Belongs-to can link to only one record', |
|
|
|
msg: 'Request must contain only one parent id', |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Link Remove: Invalid body parameter - row id invalid
|
|
|
|
// Link Remove: Invalid body parameter - row id invalid
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) |
|
|
|
console.log('Link Remove: Invalid body parameter - row id invalid'); |
|
|
|
console.log('Link Remove: Invalid body parameter - row id invalid'); |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
@ -2409,7 +2403,7 @@ function linkBased() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Link Remove: Invalid body parameter - repeated row id
|
|
|
|
// Link Remove: Invalid body parameter - repeated row id
|
|
|
|
// if (debugMode)
|
|
|
|
if (debugMode) |
|
|
|
console.log('Link Remove: Invalid body parameter - repeated row id'); |
|
|
|
console.log('Link Remove: Invalid body parameter - repeated row id'); |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
await ncAxiosLinkRemove({ |
|
|
|
...validParams, |
|
|
|
...validParams, |
|
|
|