File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -748,6 +748,11 @@ describe('Link', () => {
748748
749749 await act ( ( ) => fireEvent . click ( updateSearchLink ) )
750750
751+ // Wait for navigation to complete and search params to update
752+ await waitFor ( ( ) => {
753+ expect ( window . location . search ) . toBe ( '?page=2&filter=inactive' )
754+ } )
755+
751756 // Verify search was updated
752757 expect ( window . location . pathname ) . toBe ( '/posts' )
753758 expect ( window . location . search ) . toBe ( '?page=2&filter=inactive' )
@@ -860,6 +865,11 @@ describe('Link', () => {
860865
861866 await act ( ( ) => fireEvent . click ( updateSearchLink ) )
862867
868+ // Wait for navigation to complete and search params to update
869+ await waitFor ( ( ) => {
870+ expect ( window . location . search ) . toBe ( '?page=2&filter=inactive' )
871+ } )
872+
863873 // Verify search was updated
864874 expect ( window . location . pathname ) . toBe ( '/Dashboard/posts' )
865875 expect ( window . location . search ) . toBe ( '?page=2&filter=inactive' )
Original file line number Diff line number Diff line change @@ -775,7 +775,12 @@ describe('Link', () => {
775775 '/posts?page=2&filter=inactive' ,
776776 )
777777
778- fireEvent . click ( updateSearchLink )
778+ await fireEvent . click ( updateSearchLink )
779+
780+ // Wait for navigation to complete and search params to update
781+ await waitFor ( ( ) => {
782+ expect ( window . location . search ) . toBe ( '?page=2&filter=inactive' )
783+ } )
779784
780785 const updatedPage = await screen . findByTestId ( 'current-page' )
781786 const updatedFilter = await screen . findByTestId ( 'current-filter' )
@@ -888,7 +893,12 @@ describe('Link', () => {
888893 '/Dashboard/posts?page=2&filter=inactive' ,
889894 )
890895
891- fireEvent . click ( updateSearchLink )
896+ await fireEvent . click ( updateSearchLink )
897+
898+ // Wait for navigation to complete and search params to update
899+ await waitFor ( ( ) => {
900+ expect ( window . location . search ) . toBe ( '?page=2&filter=inactive' )
901+ } )
892902
893903 await screen . findByTestId ( 'current-page' )
894904 // Verify search was updated
You can’t perform that action at this time.
0 commit comments