Don't run for mssql and oracle
This commit is contained in:
parent
3186179f0e
commit
266ae96a80
|
@ -2554,96 +2554,98 @@ describe.each([
|
||||||
tableId = table._id!
|
tableId = table._id!
|
||||||
})
|
})
|
||||||
|
|
||||||
it.each([
|
!isMSSQL &&
|
||||||
["get row", (row: Row) => config.api.row.get(tableId, row._id!)],
|
!isOracle &&
|
||||||
[
|
it.each([
|
||||||
"fetch",
|
["get row", (row: Row) => config.api.row.get(tableId, row._id!)],
|
||||||
async (row: Row) => {
|
[
|
||||||
const rows = await config.api.row.fetch(tableId)
|
"fetch",
|
||||||
return rows.find(r => r._id === row._id)
|
async (row: Row) => {
|
||||||
},
|
const rows = await config.api.row.fetch(tableId)
|
||||||
],
|
return rows.find(r => r._id === row._id)
|
||||||
[
|
},
|
||||||
"search",
|
],
|
||||||
async (row: Row) => {
|
[
|
||||||
const { rows } = await config.api.row.search(tableId)
|
"search",
|
||||||
return rows.find(r => r._id === row._id)
|
async (row: Row) => {
|
||||||
},
|
const { rows } = await config.api.row.search(tableId)
|
||||||
],
|
return rows.find(r => r._id === row._id)
|
||||||
[
|
},
|
||||||
"from view",
|
],
|
||||||
async (row: Row) => {
|
[
|
||||||
const table = await config.api.table.get(tableId)
|
"from view",
|
||||||
const view = await config.api.viewV2.create({
|
async (row: Row) => {
|
||||||
name: generator.guid(),
|
const table = await config.api.table.get(tableId)
|
||||||
tableId,
|
const view = await config.api.viewV2.create({
|
||||||
schema: Object.keys(table.schema).reduce(
|
name: generator.guid(),
|
||||||
(acc, c) => ({ ...acc, [c]: { visible: true } }),
|
tableId,
|
||||||
{}
|
schema: Object.keys(table.schema).reduce(
|
||||||
),
|
(acc, c) => ({ ...acc, [c]: { visible: true } }),
|
||||||
})
|
{}
|
||||||
const { rows } = await config.api.viewV2.search(view.id)
|
),
|
||||||
return rows.find(r => r._id === row._id!)
|
})
|
||||||
},
|
const { rows } = await config.api.viewV2.search(view.id)
|
||||||
],
|
return rows.find(r => r._id === row._id!)
|
||||||
["from original saved row", (row: Row) => row],
|
},
|
||||||
])(
|
],
|
||||||
"can retrieve rows with populated relationships (via %s)",
|
["from original saved row", (row: Row) => row],
|
||||||
async (__, retrieveDelegate) => {
|
])(
|
||||||
const otherRows = _.sampleSize(auxData, 5)
|
"can retrieve rows with populated relationships (via %s)",
|
||||||
|
async (__, retrieveDelegate) => {
|
||||||
|
const otherRows = _.sampleSize(auxData, 5)
|
||||||
|
|
||||||
const row = await config.api.row.save(tableId, {
|
const row = await config.api.row.save(tableId, {
|
||||||
title: generator.word(),
|
title: generator.word(),
|
||||||
relWithNoSchema: [otherRows[0]],
|
relWithNoSchema: [otherRows[0]],
|
||||||
relWithEmptySchema: [otherRows[1]],
|
relWithEmptySchema: [otherRows[1]],
|
||||||
relWithFullSchema: [otherRows[2]],
|
relWithFullSchema: [otherRows[2]],
|
||||||
relWithHalfSchema: [otherRows[3]],
|
relWithHalfSchema: [otherRows[3]],
|
||||||
relWithIllegalSchema: [otherRows[4]],
|
relWithIllegalSchema: [otherRows[4]],
|
||||||
})
|
|
||||||
|
|
||||||
const retrieved = await retrieveDelegate(row)
|
|
||||||
expect(retrieved).toEqual(
|
|
||||||
expect.objectContaining({
|
|
||||||
title: row.title,
|
|
||||||
relWithNoSchema: [
|
|
||||||
{
|
|
||||||
_id: otherRows[0]._id,
|
|
||||||
primaryDisplay: otherRows[0].name,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
relWithEmptySchema: [
|
|
||||||
{
|
|
||||||
_id: otherRows[1]._id,
|
|
||||||
primaryDisplay: otherRows[1].name,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
relWithFullSchema: [
|
|
||||||
{
|
|
||||||
_id: otherRows[2]._id,
|
|
||||||
primaryDisplay: otherRows[2].name,
|
|
||||||
name: otherRows[2].name,
|
|
||||||
age: otherRows[2].age,
|
|
||||||
id: otherRows[2].id,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
relWithHalfSchema: [
|
|
||||||
{
|
|
||||||
_id: otherRows[3]._id,
|
|
||||||
primaryDisplay: otherRows[3].name,
|
|
||||||
name: otherRows[3].name,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
relWithIllegalSchema: [
|
|
||||||
{
|
|
||||||
_id: otherRows[4]._id,
|
|
||||||
primaryDisplay: otherRows[4].name,
|
|
||||||
name: otherRows[4].name,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
)
|
|
||||||
}
|
const retrieved = await retrieveDelegate(row)
|
||||||
)
|
expect(retrieved).toEqual(
|
||||||
|
expect.objectContaining({
|
||||||
|
title: row.title,
|
||||||
|
relWithNoSchema: [
|
||||||
|
{
|
||||||
|
_id: otherRows[0]._id,
|
||||||
|
primaryDisplay: otherRows[0].name,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
relWithEmptySchema: [
|
||||||
|
{
|
||||||
|
_id: otherRows[1]._id,
|
||||||
|
primaryDisplay: otherRows[1].name,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
relWithFullSchema: [
|
||||||
|
{
|
||||||
|
_id: otherRows[2]._id,
|
||||||
|
primaryDisplay: otherRows[2].name,
|
||||||
|
name: otherRows[2].name,
|
||||||
|
age: otherRows[2].age,
|
||||||
|
id: otherRows[2].id,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
relWithHalfSchema: [
|
||||||
|
{
|
||||||
|
_id: otherRows[3]._id,
|
||||||
|
primaryDisplay: otherRows[3].name,
|
||||||
|
name: otherRows[3].name,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
relWithIllegalSchema: [
|
||||||
|
{
|
||||||
|
_id: otherRows[4]._id,
|
||||||
|
primaryDisplay: otherRows[4].name,
|
||||||
|
name: otherRows[4].name,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("Formula fields", () => {
|
describe("Formula fields", () => {
|
||||||
|
|
Loading…
Reference in New Issue