Browse Source

test: checkbox sort filter update

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/4885/head
Raju Udava 2 years ago
parent
commit
5a2031062b
  1. 4
      packages/nc-gui/utils/filterUtils.ts
  2. 9
      tests/playwright/tests/columnCheckbox.spec.ts

4
packages/nc-gui/utils/filterUtils.ts

@ -41,13 +41,13 @@ export const comparisonOpList: {
text: 'is empty', text: 'is empty',
value: 'empty', value: 'empty',
ignoreVal: true, ignoreVal: true,
excludedTypes: [UITypes.Checkbox], excludedTypes: [UITypes.Checkbox, UITypes.Rating],
}, },
{ {
text: 'is not empty', text: 'is not empty',
value: 'notempty', value: 'notempty',
ignoreVal: true, ignoreVal: true,
excludedTypes: [UITypes.Checkbox], excludedTypes: [UITypes.Checkbox, UITypes.Rating],
}, },
{ {
text: 'is null', text: 'is null',

9
tests/playwright/tests/columnCheckbox.spec.ts

@ -2,7 +2,6 @@ import { test } from '@playwright/test';
import { DashboardPage } from '../pages/Dashboard'; import { DashboardPage } from '../pages/Dashboard';
import setup from '../setup'; import setup from '../setup';
import { ToolbarPage } from '../pages/Dashboard/common/Toolbar'; import { ToolbarPage } from '../pages/Dashboard/common/Toolbar';
import { isPg } from '../setup/db';
test.describe('Checkbox - cell, filter, sort', () => { test.describe('Checkbox - cell, filter, sort', () => {
let dashboard: DashboardPage, toolbar: ToolbarPage; let dashboard: DashboardPage, toolbar: ToolbarPage;
@ -87,10 +86,10 @@ test.describe('Checkbox - cell, filter, sort', () => {
// Filter column // Filter column
await verifyFilter({ opType: 'is checked', result: ['1a', '1c', '1f'] }); await verifyFilter({ opType: 'is checked', result: ['1a', '1c', '1f'] });
await verifyFilter({ opType: 'is not checked', result: ['1b', '1d', '1e'] }); await verifyFilter({ opType: 'is not checked', result: ['1b', '1d', '1e'] });
await verifyFilter({ opType: 'is equal', value: '0', result: ['1b'] }); await verifyFilter({ opType: 'is equal', value: '0', result: ['1b', '1d', '1e'] });
await verifyFilter({ opType: 'is not equal', value: '1', result: ['1b', '1d', '1e'] }); await verifyFilter({ opType: 'is not equal', value: '1', result: ['1b', '1d', '1e'] });
await verifyFilter({ opType: 'is null', result: ['1d', '1e'] }); await verifyFilter({ opType: 'is null', result: [] });
await verifyFilter({ opType: 'is not null', result: ['1a', '1b', '1c', '1f'] }); await verifyFilter({ opType: 'is not null', result: ['1a', '1b', '1c', '1d', '1e', '1f'] });
// Sort column // Sort column
await toolbar.sort.add({ await toolbar.sort.add({
@ -98,7 +97,7 @@ test.describe('Checkbox - cell, filter, sort', () => {
isAscending: true, isAscending: true,
isLocallySaved: false, isLocallySaved: false,
}); });
await validateRowArray(['1d', '1e', '1b', '1a', '1c', '1f']); await validateRowArray(['1b', '1d', '1e', '1a', '1c', '1f']);
await toolbar.sort.reset(); await toolbar.sort.reset();
// sort descending & validate // sort descending & validate

Loading…
Cancel
Save