Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/react-router/tests/link.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,11 @@ describe('Link', () => {

await act(() => fireEvent.click(updateSearchLink))

// Wait for navigation to complete and search params to update
await waitFor(() => {
expect(window.location.search).toBe('?page=2&filter=inactive')
})

// Verify search was updated
expect(window.location.pathname).toBe('/posts')
expect(window.location.search).toBe('?page=2&filter=inactive')
Expand Down Expand Up @@ -860,6 +865,11 @@ describe('Link', () => {

await act(() => fireEvent.click(updateSearchLink))

// Wait for navigation to complete and search params to update
await waitFor(() => {
expect(window.location.search).toBe('?page=2&filter=inactive')
})

// Verify search was updated
expect(window.location.pathname).toBe('/Dashboard/posts')
expect(window.location.search).toBe('?page=2&filter=inactive')
Expand Down
14 changes: 12 additions & 2 deletions packages/solid-router/tests/link.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,12 @@ describe('Link', () => {
'/posts?page=2&filter=inactive',
)

fireEvent.click(updateSearchLink)
await fireEvent.click(updateSearchLink)

// Wait for navigation to complete and search params to update
await waitFor(() => {
expect(window.location.search).toBe('?page=2&filter=inactive')
})

const updatedPage = await screen.findByTestId('current-page')
const updatedFilter = await screen.findByTestId('current-filter')
Expand Down Expand Up @@ -888,7 +893,12 @@ describe('Link', () => {
'/Dashboard/posts?page=2&filter=inactive',
)

fireEvent.click(updateSearchLink)
await fireEvent.click(updateSearchLink)

// Wait for navigation to complete and search params to update
await waitFor(() => {
expect(window.location.search).toBe('?page=2&filter=inactive')
})

await screen.findByTestId('current-page')
// Verify search was updated
Expand Down
Loading