|
|
@ -6,7 +6,13 @@ import { expect } from 'chai'; |
|
|
|
import init from '../../init'; |
|
|
|
import init from '../../init'; |
|
|
|
import { createProject, createSakilaProject } from '../../factory/base'; |
|
|
|
import { createProject, createSakilaProject } from '../../factory/base'; |
|
|
|
import { createColumn, createQrCodeColumn } from '../../factory/column'; |
|
|
|
import { createColumn, createQrCodeColumn } from '../../factory/column'; |
|
|
|
import { getTable } from '../../factory/table'; |
|
|
|
import { |
|
|
|
|
|
|
|
createTable, |
|
|
|
|
|
|
|
getColumnsByAPI, |
|
|
|
|
|
|
|
getTable, |
|
|
|
|
|
|
|
getTableByAPI, |
|
|
|
|
|
|
|
} from '../../factory/table'; |
|
|
|
|
|
|
|
import { createBulkRows, listRow, rowMixedValue } from '../../factory/row'; |
|
|
|
import type Model from '../../../../src/models/Model'; |
|
|
|
import type Model from '../../../../src/models/Model'; |
|
|
|
import type Base from '~/models/Base'; |
|
|
|
import type Base from '~/models/Base'; |
|
|
|
import type Column from '../../../../src/models/Column'; |
|
|
|
import type Column from '../../../../src/models/Column'; |
|
|
@ -27,6 +33,7 @@ function columnTypeSpecificTests() { |
|
|
|
const qrValueReferenceColumnTitle = 'Qr Value Column'; |
|
|
|
const qrValueReferenceColumnTitle = 'Qr Value Column'; |
|
|
|
const qrCodeReferenceColumnTitle = 'Qr Code Column'; |
|
|
|
const qrCodeReferenceColumnTitle = 'Qr Code Column'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('Qr Code Column', () => { |
|
|
|
beforeEach(async function () { |
|
|
|
beforeEach(async function () { |
|
|
|
console.time('#### columnTypeSpecificTests'); |
|
|
|
console.time('#### columnTypeSpecificTests'); |
|
|
|
context = await init(true); |
|
|
|
context = await init(true); |
|
|
@ -54,7 +61,6 @@ function columnTypeSpecificTests() { |
|
|
|
console.timeEnd('#### columnTypeSpecificTests'); |
|
|
|
console.timeEnd('#### columnTypeSpecificTests'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
describe('Qr Code Column', () => { |
|
|
|
|
|
|
|
it('delivers the same cell values as the referenced column', async () => { |
|
|
|
it('delivers the same cell values as the referenced column', async () => { |
|
|
|
const resp = await request(context.app) |
|
|
|
const resp = await request(context.app) |
|
|
|
.get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`) |
|
|
|
.get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`) |
|
|
@ -93,6 +99,69 @@ function columnTypeSpecificTests() { |
|
|
|
).to.eq(false); |
|
|
|
).to.eq(false); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Created-at, Last-modified-at field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let table: Model; |
|
|
|
|
|
|
|
let columns: any[]; |
|
|
|
|
|
|
|
let unfilteredRecords: any[] = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe.skip('CreatedAt, LastModifiedAt Field', () => { |
|
|
|
|
|
|
|
beforeEach(async function () { |
|
|
|
|
|
|
|
context = await init(); |
|
|
|
|
|
|
|
base = await createProject(context); |
|
|
|
|
|
|
|
table = await createTable(context, base, { |
|
|
|
|
|
|
|
table_name: 'dateBased', |
|
|
|
|
|
|
|
title: 'dateBased', |
|
|
|
|
|
|
|
columns: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
column_name: 'Id', |
|
|
|
|
|
|
|
title: 'Id', |
|
|
|
|
|
|
|
uidt: UITypes.ID, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
column_name: 'Date', |
|
|
|
|
|
|
|
title: 'Date', |
|
|
|
|
|
|
|
uidt: UITypes.Date, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// column_name: 'CreatedAt',
|
|
|
|
|
|
|
|
// title: 'CreatedAt',
|
|
|
|
|
|
|
|
// uidt: UITypes.CreatedTime,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// column_name: 'LastModifiedAt',
|
|
|
|
|
|
|
|
// title: 'LastModifiedAt',
|
|
|
|
|
|
|
|
// uidt: UITypes.LastModifiedTime,
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
columns = await table.getColumns(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const rowAttributes = []; |
|
|
|
|
|
|
|
for (let i = 0; i < 100; i++) { |
|
|
|
|
|
|
|
const row = { |
|
|
|
|
|
|
|
Date: rowMixedValue(columns[1], i), |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
rowAttributes.push(row); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await createBulkRows(context, { |
|
|
|
|
|
|
|
base, |
|
|
|
|
|
|
|
table, |
|
|
|
|
|
|
|
values: rowAttributes, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
unfilteredRecords = await listRow({ base, table }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// verify length of unfiltered records to be 800
|
|
|
|
|
|
|
|
expect(unfilteredRecords.length).to.equal(100); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('should filter records by created-at field', async () => { |
|
|
|
|
|
|
|
console.log('test'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export default function () { |
|
|
|
export default function () { |
|
|
|