Browse Source

test: filter for duration column

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5029/head
Raju Udava 2 years ago
parent
commit
2adb058795
  1. 20
      packages/nocodb/tests/unit/rest/tests/filter.test.ts

20
packages/nocodb/tests/unit/rest/tests/filter.test.ts

@ -25,7 +25,11 @@ async function retrieveRecordsAndValidate(
) {
let expectedRecords = [];
let toFloat = false;
if (['Number', 'Decimal', 'Currency', 'Percent', 'Rating'].includes(title)) {
if (
['Number', 'Decimal', 'Currency', 'Percent', 'Duration', 'Rating'].includes(
title
)
) {
toFloat = true;
}
@ -431,6 +435,20 @@ function filterNumberBased() {
await verifyFilters('Percent', columns[4].id, filterList);
});
it('Type: Duration', async () => {
let filterList = [
{ comparison_op: 'eq', value: '10' },
{ comparison_op: 'neq', value: '10' },
{ comparison_op: 'null', value: '' },
{ comparison_op: 'notnull', value: '' },
{ comparison_op: 'gt', value: '50' },
{ comparison_op: 'gte', value: '50' },
{ comparison_op: 'lt', value: '50' },
{ comparison_op: 'lte', value: '50' },
];
await verifyFilters('Duration', columns[5].id, filterList);
});
it('Type: Rating', async () => {
let filterList = [
{ comparison_op: 'eq', value: '3' },

Loading…
Cancel
Save