@@ -759,6 +759,87 @@ describe('IgxPivotGrid #pivotGrid', () => {
759759 expect ( filtersChip ) . not . toBeUndefined ( ) ;
760760 } ) ;
761761
762+ it ( 'should do nothing on filtering pointer down' , ( ) => {
763+ const pivotGrid = fixture . componentInstance . pivotGrid ;
764+ pivotGrid . pivotConfiguration . filters = [
765+ {
766+ memberName : 'Date' ,
767+ enabled : true
768+ } ,
769+ {
770+ memberName : 'ProductCategory' ,
771+ enabled : true
772+ }
773+ ] ;
774+
775+ pivotGrid . pivotConfiguration . rows = [ {
776+ memberName : 'SellerName' ,
777+ enabled : true
778+ } ] ;
779+ pivotGrid . pipeTrigger ++ ;
780+ pivotGrid . setupColumns ( ) ;
781+ fixture . detectChanges ( ) ;
782+
783+ const headerRow = fixture . debugElement . queryAll (
784+ By . directive ( IgxPivotHeaderRowComponent ) ) [ 0 ] . componentInstance ;
785+ const filtersChip = headerRow . nativeElement . querySelector ( 'igx-chip[id="Date"]' ) ;
786+ expect ( filtersChip ) . not . toBeUndefined ( ) ;
787+ const filterIcon = filtersChip . querySelectorAll ( 'igx-icon' ) [ 1 ] ;
788+ spyOn ( headerRow , "onFilteringIconPointerDown" ) ;
789+
790+ filterIcon . dispatchEvent ( new Event ( 'pointerdown' ) ) ;
791+ fixture . detectChanges ( ) ;
792+
793+ expect ( headerRow . onFilteringIconPointerDown ) . toHaveBeenCalledTimes ( 1 ) ;
794+ } ) ;
795+
796+ it ( 'should correctly remove chip from filters dropdown' , ( ) => {
797+ const pivotGrid = fixture . componentInstance . pivotGrid ;
798+ pivotGrid . pivotConfiguration = {
799+ columns : [ ] ,
800+ rows : [
801+ {
802+ memberName : 'SellerName' ,
803+ enabled : true
804+ }
805+ ] ,
806+ filters : [
807+ {
808+ memberName : 'Date' ,
809+ enabled : true
810+ } ,
811+ {
812+ memberName : 'ProductCategory' ,
813+ enabled : true
814+ } ,
815+ {
816+ memberName : 'Country' ,
817+ enabled : true
818+ }
819+ ]
820+ } ;
821+ pivotGrid . pipeTrigger ++ ;
822+ pivotGrid . setupColumns ( ) ;
823+ fixture . detectChanges ( ) ;
824+
825+ const headerRow = fixture . nativeElement . querySelector ( 'igx-pivot-header-row' ) ;
826+ const dropdownIcon = headerRow . querySelector ( '.igx-grid__tr-pivot--filter' ) . querySelectorAll ( 'igx-icon' ) [ 4 ] ;
827+ expect ( dropdownIcon ) . not . toBeUndefined ( ) ;
828+ expect ( headerRow . querySelector ( 'igx-badge' ) . innerText ) . toBe ( '2' ) ;
829+ dropdownIcon . click ( ) ;
830+ fixture . detectChanges ( ) ;
831+
832+ const excelMenu = GridFunctions . getExcelStyleFilteringComponents ( fixture , 'igx-pivot-grid' ) [ 0 ] ;
833+ const chip = excelMenu . querySelectorAll ( 'igx-chip' ) [ 0 ] ;
834+ const removeIcon = chip . querySelectorAll ( 'igx-icon' ) [ 1 ] ;
835+ removeIcon . click ( ) ;
836+ fixture . detectChanges ( ) ;
837+
838+ const filtersChip = headerRow . querySelector ( 'igx-chip[id="Date"]' ) ;
839+ expect ( filtersChip ) . toBeDefined ( ) ;
840+ expect ( headerRow . querySelector ( 'igx-chip[id="ProductCategory"]' ) ) . toBeNull ( ) ;
841+ } ) ;
842+
762843 it ( 'should apply sorting for dimension via row chip' , ( ) => {
763844 fixture . detectChanges ( ) ;
764845 const pivotGrid = fixture . componentInstance . pivotGrid ;
@@ -1119,6 +1200,13 @@ describe('IgxPivotGrid #pivotGrid', () => {
11191200 owner : colChip2
11201201 } , colChipArea , PivotDimensionType . Column ) ;
11211202 pivotGrid . cdr . detectChanges ( ) ;
1203+
1204+ headerRow . onDimDragLeave ( {
1205+ owner : colChip2
1206+ } ) ;
1207+ expect ( ( colChip2 . nativeElement . previousElementSibling as any ) . style . visibility ) . toBe ( 'hidden' ) ;
1208+ expect ( ( colChip2 . nativeElement . nextElementSibling as any ) . style . visibility ) . toBe ( 'hidden' ) ;
1209+
11221210 //check chip order is updated.
11231211 expect ( colChipArea . chipsList . toArray ( ) [ 0 ] . id ) . toBe ( colChip2 . id ) ;
11241212 expect ( colChipArea . chipsList . toArray ( ) [ 1 ] . id ) . toBe ( colChip1 . id ) ;
0 commit comments