Skip to content

Commit c0c8541

Browse files
committed
chore(*): Fix failing tests and update demos.
1 parent 9cce677 commit c0c8541

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid-row-pinning.spec.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ describe('Row Pinning #grid', () => {
859859

860860
const firstRowCell = grid.getRowByIndex(0).cells.toArray()[1];
861861
UIInteractions.simulateClickAndSelectEvent(firstRowCell);
862+
await wait(DEBOUNCE_TIME);
862863
fix.detectChanges();
863864

864865
UIInteractions.triggerEventHandlerKeyDown('ArrowDown', gridContent, false, false, true);
@@ -880,9 +881,10 @@ describe('Row Pinning #grid', () => {
880881
grid.navigateTo(10);
881882
await wait(DEBOUNCE_TIME);
882883
fix.detectChanges();
883-
884+
884885
const firstRowCell = grid.getRowByIndex(0).cells.toArray()[1];
885886
UIInteractions.simulateClickAndSelectEvent(firstRowCell);
887+
await wait(DEBOUNCE_TIME);
886888
fix.detectChanges();
887889

888890
UIInteractions.triggerEventHandlerKeyDown('ArrowDown', gridContent);
@@ -904,11 +906,14 @@ describe('Row Pinning #grid', () => {
904906
grid.navigateTo(27);
905907
await wait(DEBOUNCE_TIME);
906908
fix.detectChanges();
907-
909+
await wait(DEBOUNCE_TIME);
910+
fix.detectChanges();
911+
908912
expect(grid.verticalScrollContainer.getScroll().scrollTop).not.toEqual(0);
909-
913+
910914
const lastRowCell = grid.getRowByIndex(27).cells.toArray()[1];
911915
UIInteractions.simulateClickAndSelectEvent(lastRowCell);
916+
await wait(DEBOUNCE_TIME);
912917
fix.detectChanges();
913918

914919
UIInteractions.triggerEventHandlerKeyDown('ArrowUp', gridContent, false, false, true);
@@ -931,6 +936,7 @@ describe('Row Pinning #grid', () => {
931936

932937
const thirdRowCell = grid.getRowByIndex(2).cells.toArray()[1];
933938
UIInteractions.simulateClickAndSelectEvent(thirdRowCell);
939+
await wait(DEBOUNCE_TIME);
934940
fix.detectChanges();
935941

936942
expect(grid.navigation.activeNode.row).toBe(2);
@@ -954,9 +960,12 @@ describe('Row Pinning #grid', () => {
954960
grid.navigateTo(26);
955961
await wait(DEBOUNCE_TIME);
956962
fix.detectChanges();
957-
963+
await wait(DEBOUNCE_TIME);
964+
fix.detectChanges();
965+
958966
const lastRowCell = grid.getRowByIndex(27).cells.toArray()[1];
959967
UIInteractions.simulateClickAndSelectEvent(lastRowCell);
968+
await wait(DEBOUNCE_TIME);
960969
fix.detectChanges();
961970

962971
expect(grid.navigation.activeNode.row).toBe(27);
@@ -981,6 +990,7 @@ describe('Row Pinning #grid', () => {
981990

982991
const firstRowCell = grid.getRowByIndex(27).cells.toArray()[1];
983992
UIInteractions.simulateClickAndSelectEvent(firstRowCell);
993+
await wait(DEBOUNCE_TIME);
984994
fix.detectChanges();
985995

986996
UIInteractions.triggerEventHandlerKeyDown('ArrowUp', gridContent);
@@ -1004,6 +1014,7 @@ describe('Row Pinning #grid', () => {
10041014

10051015
const firstRowCell = grid.getRowByIndex(0).cells.toArray()[1];
10061016
UIInteractions.simulateClickAndSelectEvent(firstRowCell);
1017+
await wait(DEBOUNCE_TIME);
10071018
fix.detectChanges();
10081019

10091020
UIInteractions.triggerEventHandlerKeyDown('ArrowDown', gridContent, false, false, true);
@@ -1028,9 +1039,12 @@ describe('Row Pinning #grid', () => {
10281039
grid.navigateTo(26);
10291040
await wait(DEBOUNCE_TIME);
10301041
fix.detectChanges();
1042+
await wait(DEBOUNCE_TIME);
1043+
fix.detectChanges();
10311044

10321045
const firstRowCell = grid.getRowByIndex(26).cells.toArray()[1];
10331046
UIInteractions.simulateClickAndSelectEvent(firstRowCell);
1047+
await wait(DEBOUNCE_TIME);
10341048
fix.detectChanges();
10351049

10361050
expect(grid.navigation.activeNode.row).toBe(26);
@@ -1056,6 +1070,7 @@ describe('Row Pinning #grid', () => {
10561070

10571071
const firstRowCell = grid.getRowByIndex(0).cells.toArray()[1];
10581072
UIInteractions.simulateClickAndSelectEvent(firstRowCell);
1073+
await wait(DEBOUNCE_TIME);
10591074
fix.detectChanges();
10601075

10611076
UIInteractions.triggerEventHandlerKeyDown('ArrowDown', gridContent);

src/app/grid-row-pinning/grid-row-pinning.sample.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</ng-template>
3535
<igx-column width='150px' [filterable]='false'>
3636
<ng-template igxCell let-cell="cell" let-val>
37-
<igx-icon class="pin-icon" (mousedown)="togglePining(cell.row, $event)"
37+
<igx-icon class="pin-icon" (mouseup)="togglePining(cell.row, $event)"
3838
fontSet="filtering-icons" name="{{cell.row.pinned ? 'unpin' : 'pin'}}">
3939
</igx-icon>
4040
</ng-template>
@@ -60,7 +60,7 @@
6060
</ng-template>
6161
<igx-column width='70px' [filterable]='false'>
6262
<ng-template igxCell let-cell="cell" let-val>
63-
<igx-icon class="pin-icon" (mousedown)="togglePining(cell.row, $event)">
63+
<igx-icon class="pin-icon" (mouseup)="togglePining(cell.row, $event)">
6464
{{cell.row.pinned ? 'lock' : 'lock_open'}}
6565
</igx-icon>
6666
</ng-template>
@@ -87,7 +87,7 @@
8787
>
8888
<igx-column width='150px' [filterable]='false'>
8989
<ng-template igxCell let-cell="cell" let-val>
90-
<igx-icon class="pin-icon" (mousedown)="togglePining(cell.row, $event)">
90+
<igx-icon class="pin-icon" (mouseup)="togglePining(cell.row, $event)">
9191
{{cell.row.pinned ? 'lock' : 'lock_open'}}
9292
</igx-icon>
9393
</ng-template>

0 commit comments

Comments
 (0)