File tree Expand file tree Collapse file tree 1 file changed +4
-20
lines changed
projects/igniteui-angular-elements/src/app Expand file tree Collapse file tree 1 file changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -48,31 +48,15 @@ describe('Elements: ', () => {
4848 const columnEl = document . createElement ( "igc-column" ) as IgcNgElement ;
4949 gridEl . appendChild ( columnEl ) ;
5050
51- // Wait for both components to be fully initialized
51+ // TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
52+ await firstValueFrom ( timer ( 10 /* SCHEDULE_DELAY */ * 2 ) ) ;
53+
5254 const gridComponent = ( await gridEl . ngElementStrategy [ ComponentRefKey ] ) . instance as IgxGridComponent ;
5355 const columnComponent = ( await columnEl . ngElementStrategy [ ComponentRefKey ] ) . instance as IgxColumnComponent ;
54-
55- // Wait for the grid's columnList to contain the column component with retry logic
56- let retries = 0 ;
57- const maxRetries = 10 ;
58- const retryDelay = 10 ;
59-
60- while ( retries < maxRetries && ! gridComponent . columnList . toArray ( ) . includes ( columnComponent ) ) {
61- await firstValueFrom ( timer ( retryDelay ) ) ;
62- retries ++ ;
63- }
64-
6556 expect ( gridComponent . columnList . toArray ( ) ) . toContain ( columnComponent ) ;
6657
6758 columnEl . remove ( ) ;
68-
69- // Wait for the column to be removed from the columnList with retry logic
70- retries = 0 ;
71- while ( retries < maxRetries && gridComponent . columnList . toArray ( ) . includes ( columnComponent ) ) {
72- await firstValueFrom ( timer ( retryDelay ) ) ;
73- retries ++ ;
74- }
75-
59+ await firstValueFrom ( timer ( 10 /* SCHEDULE_DELAY: DESTROY + QUERY */ * 3 ) ) ;
7660 expect ( gridComponent . columnList . toArray ( ) ) . toEqual ( [ ] ) ;
7761 } ) ;
7862
You can’t perform that action at this time.
0 commit comments