|
|
@ -192,23 +192,13 @@ function viewRowStaticTests() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const testGetViewDataListWithRequiredColumns = async (view: View) => { |
|
|
|
const testGetViewDataListWithRequiredColumns = async (view: View) => { |
|
|
|
const columns = |
|
|
|
const requiredColumns = customerColumns |
|
|
|
view.type === ViewTypes.CALENDAR ? rentalColumns : customerColumns; |
|
|
|
|
|
|
|
const requiredColumns = columns |
|
|
|
|
|
|
|
.filter((_, index) => index < 3) |
|
|
|
.filter((_, index) => index < 3) |
|
|
|
.filter((c: ColumnType) => c.uidt !== UITypes.ForeignKey); |
|
|
|
.filter((c: ColumnType) => c.uidt !== UITypes.ForeignKey); |
|
|
|
|
|
|
|
|
|
|
|
let table; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (view.type === ViewTypes.CALENDAR) { |
|
|
|
|
|
|
|
table = rentalTable; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
table = customerTable; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const response = await request(context.app) |
|
|
|
const response = await request(context.app) |
|
|
|
.get( |
|
|
|
.get( |
|
|
|
`/api/v1/db/data/noco/${sakilaProject.id}/${table.id}/views/${view.id}`, |
|
|
|
`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, |
|
|
|
) |
|
|
|
) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.query({ |
|
|
|
.query({ |
|
|
@ -241,9 +231,6 @@ function viewRowStaticTests() { |
|
|
|
it('Get view data list with required columns grid', async () => { |
|
|
|
it('Get view data list with required columns grid', async () => { |
|
|
|
await testGetViewDataListWithRequiredColumns(customerGridView); |
|
|
|
await testGetViewDataListWithRequiredColumns(customerGridView); |
|
|
|
}); |
|
|
|
}); |
|
|
|
it('Get view data list with required columns grid', async () => { |
|
|
|
|
|
|
|
await testGetViewDataListWithRequiredColumns(rentalCalendarView); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const testGetGroupedViewDataListWithRequiredColumns = async (view: View) => { |
|
|
|
const testGetGroupedViewDataListWithRequiredColumns = async (view: View) => { |
|
|
|
const requiredColumns = filmColumns |
|
|
|
const requiredColumns = filmColumns |
|
|
|