/**
 * Grid Filtering spec document
 */ import { createElement } from '@syncfusion/ej2-base' ; import { Grid } from '../../../src/grid/base/grid' ; import { PredicateModel } from '../../../src/grid/base/grid-model' ; import { BatchEdit } from '../../../src/grid/actions/batch-edit' ; import { Filter } from '../../../src/grid/actions/filter' ; import { Group } from '../../../src/grid/actions/group' ; import { Page } from '../../../src/grid/actions/page' ; import { Toolbar } from '../../../src/grid/actions/toolbar' ; import { Freeze } from '../../../src/grid/actions/freeze' ; import { CellType } from '../../../src/grid/base/enum' ; import { ValueFormatter } from '../../../src/grid/services/value-formatter' ; import { Column } from '../../../src/grid/models/column' ; import { Selection } from '../../../src/grid/actions/selection' ; import { filterData } from '../base/datasource.spec' ; import { createGrid , destroy , getKeyUpObj , getClickObj , getKeyActionObj } from '../base/specutil.spec' ; import '../../../node_modules/es6-promise/dist/es6-promise' ; import { Edit } from '../../../src/grid/actions/edit' ; Grid . Inject ( Filter , Page , Toolbar , Selection , Group , Freeze , Edit ) ; describe ( 'Checkbox Filter module => ' , ( ) => { let checkFilterObj = ( obj , field ? , operator ? , value ? , predicate ? , matchCase ? ) : boolean => { let isEqual = true ; if ( field ) { isEqual = isEqual && obj . field === field ; } if ( operator ) { isEqual = isEqual && obj . operator === operator ; } if ( value ) { isEqual = isEqual && obj . value === value ; } if ( matchCase ) { isEqual = isEqual && obj . matchCase === matchCase ; } return isEqual ; } ; let filterColumn = ( gridObj , colName , value , keyCode ? ) => { let filterElement = gridObj . element . querySelector ( '#' + colName + '_filterBarcell' ) ; filterElement . value = value ; filterElement . focus ( ) ; ( gridObj . filterModule as any ) . keyUpHandler ( getKeyUpObj ( keyCode ? keyCode : 13 , filterElement ) ) ; } ; let clearFilter = ( gridObj , done ) => { let actionComplete = ( args ? ) : void => { if ( gridObj . element . querySelectorAll ( '.e-row' ) . length === filterData . length && gridObj . filterSettings . columns . length === 0 ) { done ( ) ; } } ; gridObj . actionComplete = actionComplete ; gridObj . clearFiltering ( ) ; } ; describe ( 'Checkbox dialog functionalities => ' , ( ) => { let gridObj ; let actionBegin ; let checkBoxFilter ; let actionComplete ; beforeAll ( ( done ) => { gridObj = createGrid ( { dataSource : filterData , allowFiltering : true , allowPaging : false , filterSettings : { type : 'CheckBox' , showFilterBarStatus : true } , columns : [ { field : 'OrderID' , type : 'number' , visible : true } , { field : 'CustomerID' , type : 'string' } , { field : 'Freight' , format : 'C2' , type : 'number' } , { field : 'OrderDate' , format : 'yMd' } ] , actionBegin : actionBegin , actionComplete : actionComplete } , done ) ; } ) ; it ( 'dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-searchinput' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-selectall' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-chk-hidden' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'intermediate state testing' , ( ) => { ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; } ) ; it ( 'search box keyup testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterchoicerequest' ) { expect ( gridObj . element . querySelector ( '.e-searchcontainer' ) . querySelectorAll ( '.e-searchinput' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-selectall' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-chk-hidden' ) . length ) . toBe ( 3 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 3 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; let searchElement = gridObj . element . querySelector ( '.e-searchinput' ) ; searchElement . value = '1024' ; ( gridObj . filterModule as any ) . filterModule . searchBoxKeyUp ( getKeyUpObj ( 13 , searchElement ) ) ; } ) ; it ( 'search box keyup repeat testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterchoicerequest' ) { expect ( checkBoxFilter . querySelectorAll ( '.e-selectall' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; let searchElement = gridObj . element . querySelector ( '.e-searchinput' ) ; searchElement . value = '10249' ; ( gridObj . filterModule as any ) . filterModule . searchBoxKeyUp ( getKeyUpObj ( 13 , searchElement ) ) ; } ) ; it ( 'search box keyup invalid input testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterchoicerequest' ) { expect ( checkBoxFilter . querySelectorAll ( '.e-selectall' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelector ( '.e-checkboxlist' ) . children [ 0 ] . innerHTML ) . toBe ( 'No Matches Found' ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; let searchElement = gridObj . element . querySelector ( '.e-searchinput' ) ; searchElement . value = '1024923' ; ( gridObj . filterModule as any ) . filterModule . searchBoxKeyUp ( getKeyUpObj ( 13 , searchElement ) ) ; } ) ; it ( 'search box keyup invalid - corrected input testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterchoicerequest' ) { expect ( checkBoxFilter . querySelectorAll ( '.e-selectall' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . children [ 0 ] . tagName . toLowerCase ( ) ) . not . toBe ( 'span' ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; let searchElement = gridObj . element . querySelector ( '.e-searchinput' ) ; searchElement . value = '10248' ; ( gridObj . filterModule as any ) . filterModule . searchBoxKeyUp ( getKeyUpObj ( 13 , searchElement ) ) ; } ) ; it ( 'clear searchbox testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterchoicerequest' ) { expect ( checkBoxFilter . querySelectorAll ( '.e-selectall' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; let searchElement = gridObj . element . querySelector ( '.e-searchinput' ) ; searchElement . value = '' ; ( gridObj . filterModule as any ) . filterModule . searchBoxKeyUp ( getKeyUpObj ( 13 , searchElement ) ) ; } ) ; it ( 'intermediate state with keyup testing' , ( done ) => { ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterchoicerequest' ) { expect ( checkBoxFilter . querySelectorAll ( '.e-selectall' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; let searchElement = gridObj . element . querySelector ( '.e-searchinput' ) ; searchElement . value = '10255' ; ( gridObj . filterModule as any ) . filterModule . searchBoxKeyUp ( getKeyUpObj ( 13 , searchElement ) ) ; } ) ; it ( 'intermediate state with keyup - clear testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterchoicerequest' ) { expect ( checkBoxFilter . querySelectorAll ( '.e-selectall' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; let searchElement = gridObj . element . querySelector ( '.e-searchinput' ) ; searchElement . value = '' ; ( gridObj . filterModule as any ) . filterModule . searchBoxKeyUp ( getKeyUpObj ( 13 , searchElement ) ) ; } ) ; it ( 'select all testing' , ( ) => { ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . getAttribute ( 'disabled' ) ) . not . toBeNull ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . getAttribute ( 'disabled' ) ) . toBeNull ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 70 ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 72 ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; } ) ; it ( 'Filter orderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 2 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 0 ] , 'OrderID' , 'notequal' , 10248 , 'and' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 69 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 69 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 69 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 43 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter CustomerID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 4 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 2 ] , 'CustomerID' , 'notequal' , 'ANATR' , 'and' , false ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 66 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 66 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 40 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 66 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter Freight testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 6 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 4 ] , 'Freight' , 'notequal' , 0.12 , 'and' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 64 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 64 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 40 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 63 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter Freight testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 4 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 66 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 66 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter CustomerID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 2 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 69 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 43 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter OrderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 0 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 71 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter orderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 2 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 0 ] , 'OrderID' , 'notequal' , 10248 , 'and' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 69 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 69 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 69 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 43 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter CustomerID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 4 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 2 ] , 'CustomerID' , 'notequal' , 'ANATR' , 'and' , false ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 66 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 66 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 40 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 66 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter Freight testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 6 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 4 ] , 'Freight' , 'notequal' , 0.12 , 'and' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 64 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 64 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 40 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 63 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter OrderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 4 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 66 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 67 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 65 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 41 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter CustomerID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 2 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 69 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 44 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 70 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 68 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter Freight testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 0 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 71 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter orderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 4 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 0 ] , 'OrderID' , 'equal' , 10248 , 'or' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 4 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 3 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 4 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 4 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 67 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 5 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 5 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter CustomerID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 6 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 5 ] , 'CustomerID' , 'equal' , 'TOMSP' , 'or' , false ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 2 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 3 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter Freight testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 7 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 6 ] , 'Freight' , 'equal' , 11.61 , 'or' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 1 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter Freight testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 6 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 2 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 3 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter CustomerID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 4 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 4 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 5 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter OrderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 0 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 71 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter orderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 4 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 0 ] , 'OrderID' , 'equal' , 10248 , 'or' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 4 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 3 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 4 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 4 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 67 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 5 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 5 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter CustomerID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 6 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 5 ] , 'CustomerID' , 'equal' , 'TOMSP' , 'or' , false ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 2 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 3 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter Freight testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 7 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 6 ] , 'Freight' , 'equal' , 11.61 , 'or' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 1 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter OrderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 3 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 1 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter CustomerID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 1 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 1 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Freight dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 1 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 69 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter Freight testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 0 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 71 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter orderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 3 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 0 ] , 'OrderID' , 'notequal' , 10248 , 'or' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 68 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 3 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 68 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 3 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter orderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 2 ) ; expect ( checkFilterObj ( gridObj . filterSettings . columns [ 0 ] , 'OrderID' , 'equal' , 10251 , 'or' , true ) ) . toBeTruthy ( ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 2 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeTruthy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 4 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 5 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'orderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 2 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 69 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 1 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Clear Filter OrderID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 0 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 71 ) ; expect ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; expect ( gridObj . getColumnHeaderByField ( 'Freight' ) . querySelector ( '.e-filtermenudiv' ) . classList . contains ( 'e-filtered' ) ) . toBeFalsy ( ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; checkBoxFilter . querySelectorAll ( 'button' ) [ 1 ] . click ( ) ; } ) ; it ( 'OrderID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-check' ) . length ) . toBe ( 72 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-uncheck' ) . length ) . toBe ( 0 ) ; expect ( checkBoxFilter . querySelectorAll ( '.e-stop' ) . length ) . toBe ( 0 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'EJ2-6971-Date filter search checking ' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { expect ( gridObj . getColumnByField ( 'OrderDate' ) . type ) . toBe ( 'datetime' ) ; checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; ( < any > gridObj . filterModule ) . filterModule . sInput . value = '7/9/1996' ; ( < any > gridObj . filterModule ) . filterModule . refreshCheckboxes ( ) ; expect ( checkBoxFilter . querySelector ( '.e-checkboxlist.e-fields' ) . children . length ) . toBeGreaterThanOrEqual ( 2 ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'OrderDate' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'EJ2-7690-Search In Filtering Dialog Box Get Closed While Press "Enter Key" ' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { ( < any > gridObj . filterModule ) . filterModule . sInput . value = 'Vinet' ; ( < any > gridObj . filterModule ) . filterModule . btnClick ( { target : ( < any > gridObj . filterModule ) . filterModule . sInput } ) ; } if ( args . requestType === 'filtering' ) { expect ( gridObj . currentViewData [ 0 ] [ 'CustomerID' ] ) . toBe ( 'VINET' ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; afterAll ( ( ) => { destroy ( gridObj ) ; } ) ; } ) ; describe ( 'EJ2-7408 Checkbox filter for column and filter type menu => ' , ( ) => { let gridObj ; let actionBegin ; let checkBoxFilter ; let actionComplete ; beforeAll ( ( done ) => { gridObj = createGrid ( { dataSource : filterData , allowFiltering : true , allowPaging : false , filterSettings : { type : 'Menu' , showFilterBarStatus : true } , columns : [ { field : 'OrderID' , type : 'number' , visible : true } , { field : 'CustomerID' , type : 'string' , filter : { type : 'CheckBox' } } , { field : 'Freight' , format : 'C2' , type : 'number' } ] , actionBegin : actionBegin , actionComplete : actionComplete } , done ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter CustomerID testing' , ( done ) => { actionComplete = ( args ? ) : void => { expect ( gridObj . filterSettings . columns . length ) . toBe ( 2 ) ; expect ( gridObj . element . querySelectorAll ( '.e-row' ) . length ) . toBe ( 68 ) ; gridObj . actionComplete = null ; done ( ) ; } ; gridObj . actionComplete = actionComplete ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 2 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; afterAll ( ( ) => { destroy ( gridObj ) ; } ) ; } ) ; describe ( 'EJ2-13031 Batch confirm for checkbox filter => ' , ( ) => { let gridObj ; let actionBegin ; let checkBoxFilter ; let preventDefault = new Function ( ) ; let actionComplete ; let cellEdit ; beforeAll ( ( done ) => { gridObj = createGrid ( { dataSource : filterData . slice ( 0 ) , allowFiltering : true , editSettings : { allowEditing : true , allowAdding : true , allowDeleting : true , mode : 'Batch' , showConfirmDialog : true , showDeleteConfirmDialog : false } , toolbar : [ 'Add' , 'Edit' , 'Delete' , 'Update' , 'Cancel' ] , allowPaging : true , filterSettings : { type : 'CheckBox' } , columns : [ { field : 'OrderID' , type : 'number' , visible : true } , { field : 'CustomerID' , type : 'string' , filter : { type : 'CheckBox' } } , { field : 'Freight' , format : 'C2' , type : 'number' } ] , actionBegin : actionBegin , actionComplete : actionComplete , cellEdit : cellEdit } , done ) ; } ) ; it ( 'edit cell' , ( ) => { gridObj . editModule . editCell ( 1 , 'CustomerID' ) ; } ) ; it ( 'shift tab key' , ( ) => { gridObj . element . querySelector ( '.e-editedbatchcell' ) . querySelector ( 'input' ) . value = 'updated' ; gridObj . editModule . saveCell ( ) ; } ) ; it ( 'CustomerID dialog open testing' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filterafteropen' ) { checkBoxFilter = gridObj . element . querySelector ( '.e-checkboxfilter' ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; ( gridObj . filterModule as any ) . filterIconClickHandler ( getClickObj ( gridObj . getColumnHeaderByField ( 'CustomerID' ) . querySelector ( '.e-filtermenudiv' ) ) ) ; } ) ; it ( 'Filter CustomerID testing' , ( ) => { ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 0 ] as any ) . click ( ) ; ( checkBoxFilter . querySelectorAll ( '.e-checkbox-wrapper' ) [ 1 ] as any ) . click ( ) ; checkBoxFilter . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; it ( 'Check confirm dialog' , ( ) => { expect ( gridObj . element . querySelector ( '#' + gridObj . element . id + 'EditConfirm' ) . classList . contains ( 'e-dialog' ) ) . toBeTruthy ( ) ; } ) ; it ( 'check data are filtered' , ( done ) => { actionComplete = ( args ? ) : void => { if ( args . requestType === 'filtering' ) { expect ( gridObj . currentViewData [ 0 ] [ 'CustomerID' ] ) . toBe ( 'ANATR' ) ; gridObj . actionComplete = null ; done ( ) ; } } ; gridObj . actionComplete = actionComplete ; gridObj . element . querySelector ( '#' + gridObj . element . id + 'EditConfirm' ) . querySelectorAll ( 'button' ) [ 0 ] . click ( ) ; } ) ; afterAll ( ( ) => { destroy ( gridObj ) ; } ) ; } ) ; } ) ;