@@ -989,46 +989,6 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
989
989
expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'ContactName' ) ;
990
990
} ) ;
991
991
992
- it ( 'should navigate correctly by pressing Ctrl + ArrowUp/ArrowDown key' , ( ) => {
993
- fix . componentInstance . colGroups = [ {
994
- group : 'group1' ,
995
- pinned : true ,
996
- columns : [
997
- { field : 'CompanyName' , rowStart : 1 , colStart : 1 , colEnd : 3 } ,
998
- { field : 'ContactName' , rowStart : 2 , colStart : 1 } ,
999
- { field : 'ContactTitle' , rowStart : 2 , colStart : 2 }
1000
- ]
1001
- } ] ;
1002
- fix . detectChanges ( ) ;
1003
-
1004
- let firstCell ;
1005
- let secondCell ;
1006
- let thirdCell ;
1007
- [
1008
- firstCell , secondCell ,
1009
- thirdCell ,
1010
- ] = fix . debugElement . queryAll ( By . css ( CELL_CSS_CLASS ) ) ;
1011
-
1012
- thirdCell . componentInstance . onFocus ( null ) ;
1013
- fix . detectChanges ( ) ;
1014
-
1015
- expect ( fix . componentInstance . selectedCell . value ) . toEqual ( fix . componentInstance . data [ 0 ] . ContactTitle ) ;
1016
- expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'ContactTitle' ) ;
1017
-
1018
- GridFunctions . simulateCellKeydown ( thirdCell . componentInstance , 'ArrowDown' , false , false , true ) ;
1019
- fix . detectChanges ( ) ;
1020
-
1021
- expect ( fix . componentInstance . selectedCell . value )
1022
- . toEqual ( fix . componentInstance . data [ fix . componentInstance . data . length - 1 ] . ContactTitle ) ;
1023
- expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'ContactTitle' ) ;
1024
-
1025
- GridFunctions . simulateCellKeydown ( fix . componentInstance . selectedCell , 'ArrowUp' , false , false , true ) ;
1026
- fix . detectChanges ( ) ;
1027
-
1028
- expect ( fix . componentInstance . selectedCell . value ) . toEqual ( fix . componentInstance . data [ 0 ] . ContactTitle ) ;
1029
- expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'ContactTitle' ) ;
1030
- } ) ;
1031
-
1032
992
it ( 'should navigate correctly with column group is hidden.' , ( ) => {
1033
993
fix . componentInstance . colGroups = [ {
1034
994
group : 'group1' ,
@@ -1845,19 +1805,69 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
1845
1805
fix . detectChanges ( ) ;
1846
1806
1847
1807
GridFunctions . simulateCellKeydown ( secondCell . componentInstance , 'ArrowDown' ) ;
1848
- await wait ( ) ;
1808
+ await wait ( DEBOUNCETIME ) ;
1849
1809
zone . simulateOnStable ( ) ;
1850
1810
fix . detectChanges ( ) ;
1851
1811
1852
1812
GridFunctions . simulateCellKeydown ( fix . componentInstance . selectedCell , 'ArrowDown' ) ;
1853
- await wait ( ) ;
1813
+ await wait ( DEBOUNCETIME ) ;
1854
1814
zone . simulateOnStable ( ) ;
1855
1815
fix . detectChanges ( ) ;
1856
1816
1857
1817
expect ( fix . componentInstance . selectedCell . value ) . toEqual ( fix . componentInstance . data [ rowIndex + 1 ] . City ) ;
1858
1818
expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'City' ) ;
1859
1819
} ) ;
1860
1820
1821
+ it ( 'should navigate correctly by pressing Ctrl + ArrowUp/ArrowDown key' , async ( ) => {
1822
+ fix . componentInstance . colGroups = [ {
1823
+ group : 'group1' ,
1824
+ pinned : true ,
1825
+ columns : [
1826
+ { field : 'CompanyName' , rowStart : 1 , colStart : 1 , colEnd : 3 } ,
1827
+ { field : 'ContactName' , rowStart : 2 , colStart : 1 } ,
1828
+ { field : 'ContactTitle' , rowStart : 2 , colStart : 2 }
1829
+ ]
1830
+ } ] ;
1831
+ fix . detectChanges ( ) ;
1832
+
1833
+ let firstCell ;
1834
+ let secondCell ;
1835
+ let thirdCell ;
1836
+ [
1837
+ firstCell , secondCell ,
1838
+ thirdCell ,
1839
+ ] = fix . debugElement . queryAll ( By . css ( CELL_CSS_CLASS ) ) ;
1840
+
1841
+ thirdCell . componentInstance . onFocus ( null ) ;
1842
+ fix . detectChanges ( ) ;
1843
+
1844
+ expect ( fix . componentInstance . selectedCell . value ) . toEqual ( fix . componentInstance . data [ 0 ] . ContactTitle ) ;
1845
+ expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'ContactTitle' ) ;
1846
+
1847
+ GridFunctions . simulateCellKeydown ( thirdCell . componentInstance , 'ArrowDown' , false , false , true ) ;
1848
+ await wait ( DEBOUNCETIME ) ;
1849
+ zone . simulateOnStable ( ) ;
1850
+ fix . detectChanges ( ) ;
1851
+ await wait ( DEBOUNCETIME ) ;
1852
+ zone . simulateOnStable ( ) ;
1853
+ fix . detectChanges ( ) ;
1854
+
1855
+ expect ( fix . componentInstance . selectedCell . value )
1856
+ . toEqual ( fix . componentInstance . data [ fix . componentInstance . data . length - 1 ] . ContactTitle ) ;
1857
+ expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'ContactTitle' ) ;
1858
+
1859
+ GridFunctions . simulateCellKeydown ( fix . componentInstance . selectedCell , 'ArrowUp' , false , false , true ) ;
1860
+ await wait ( DEBOUNCETIME ) ;
1861
+ zone . simulateOnStable ( ) ;
1862
+ fix . detectChanges ( ) ;
1863
+ await wait ( DEBOUNCETIME ) ;
1864
+ zone . simulateOnStable ( ) ;
1865
+ fix . detectChanges ( ) ;
1866
+
1867
+ expect ( fix . componentInstance . selectedCell . value ) . toEqual ( fix . componentInstance . data [ 0 ] . ContactTitle ) ;
1868
+ expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'ContactTitle' ) ;
1869
+ } ) ;
1870
+
1861
1871
it ( 'should navigate to the last cell from the layout by pressing Home/End or Ctrl + ArrowLeft/ArrowRight key' , async ( ) => {
1862
1872
fix . componentInstance . colGroups = [ {
1863
1873
group : 'group1' ,
@@ -1895,47 +1905,47 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
1895
1905
fix . detectChanges ( ) ;
1896
1906
1897
1907
GridFunctions . simulateCellKeydown ( firstCell . componentInstance , 'end' ) ;
1898
- await wait ( ) ;
1908
+ await wait ( DEBOUNCETIME ) ;
1899
1909
zone . simulateOnStable ( ) ;
1900
1910
fix . detectChanges ( ) ;
1901
1911
1902
- await wait ( ) ;
1912
+ await wait ( DEBOUNCETIME ) ;
1903
1913
zone . simulateOnStable ( ) ;
1904
1914
fix . detectChanges ( ) ;
1905
1915
1906
1916
expect ( fix . componentInstance . selectedCell . value ) . toEqual ( fix . componentInstance . data [ 0 ] . Phone ) ;
1907
1917
expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'Phone' ) ;
1908
1918
1909
1919
GridFunctions . simulateCellKeydown ( fix . componentInstance . selectedCell , 'home' ) ;
1910
- await wait ( ) ;
1920
+ await wait ( DEBOUNCETIME ) ;
1911
1921
zone . simulateOnStable ( ) ;
1912
1922
fix . detectChanges ( ) ;
1913
1923
1914
- await wait ( ) ;
1924
+ await wait ( DEBOUNCETIME ) ;
1915
1925
zone . simulateOnStable ( ) ;
1916
1926
fix . detectChanges ( ) ;
1917
1927
1918
1928
expect ( fix . componentInstance . selectedCell . value ) . toEqual ( fix . componentInstance . data [ 0 ] . CompanyName ) ;
1919
1929
expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'CompanyName' ) ;
1920
1930
1921
1931
GridFunctions . simulateCellKeydown ( firstCell . componentInstance , 'ArrowRight' , false , false , true ) ;
1922
- await wait ( ) ;
1932
+ await wait ( DEBOUNCETIME ) ;
1923
1933
zone . simulateOnStable ( ) ;
1924
1934
fix . detectChanges ( ) ;
1925
1935
1926
- await wait ( ) ;
1936
+ await wait ( DEBOUNCETIME ) ;
1927
1937
zone . simulateOnStable ( ) ;
1928
1938
fix . detectChanges ( ) ;
1929
1939
1930
1940
expect ( fix . componentInstance . selectedCell . value ) . toEqual ( fix . componentInstance . data [ 0 ] . Phone ) ;
1931
1941
expect ( fix . componentInstance . selectedCell . column . field ) . toMatch ( 'Phone' ) ;
1932
1942
1933
1943
GridFunctions . simulateCellKeydown ( fix . componentInstance . selectedCell , 'ArrowLeft' , false , false , true ) ;
1934
- await wait ( ) ;
1944
+ await wait ( DEBOUNCETIME ) ;
1935
1945
zone . simulateOnStable ( ) ;
1936
1946
fix . detectChanges ( ) ;
1937
1947
1938
- await wait ( ) ;
1948
+ await wait ( DEBOUNCETIME ) ;
1939
1949
zone . simulateOnStable ( ) ;
1940
1950
fix . detectChanges ( ) ;
1941
1951
@@ -2539,7 +2549,7 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
2539
2549
2540
2550
// arrow down
2541
2551
GridFunctions . simulateCellKeydown ( cell , 'ArrowDown' ) ;
2542
- await wait ( ) ;
2552
+ await wait ( DEBOUNCETIME ) ;
2543
2553
zone . simulateOnStable ( ) ;
2544
2554
fix . detectChanges ( ) ;
2545
2555
@@ -2557,7 +2567,7 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
2557
2567
2558
2568
// arrow up
2559
2569
GridFunctions . simulateCellKeydown ( cell , 'ArrowUp' ) ;
2560
- await wait ( ) ;
2570
+ await wait ( DEBOUNCETIME ) ;
2561
2571
zone . simulateOnStable ( ) ;
2562
2572
fix . detectChanges ( ) ;
2563
2573
@@ -2575,7 +2585,7 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
2575
2585
2576
2586
// arrow right
2577
2587
GridFunctions . simulateCellKeydown ( cell , 'ArrowRight' ) ;
2578
- await wait ( ) ;
2588
+ await wait ( DEBOUNCETIME ) ;
2579
2589
zone . simulateOnStable ( ) ;
2580
2590
fix . detectChanges ( ) ;
2581
2591
@@ -2593,7 +2603,7 @@ describe('IgxGrid Multi Row Layout - Keyboard navigation #grid', () => {
2593
2603
2594
2604
// arrow left
2595
2605
GridFunctions . simulateCellKeydown ( cell , 'ArrowLeft' ) ;
2596
- await wait ( ) ;
2606
+ await wait ( DEBOUNCETIME ) ;
2597
2607
zone . simulateOnStable ( ) ;
2598
2608
fix . detectChanges ( ) ;
2599
2609
0 commit comments