Skip to content

Commit 08d78c1

Browse files
authored
test(solid-router): un-skip link tests (#5621)
1 parent 735c1e3 commit 08d78c1

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

packages/solid-router/src/link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export function useLinkProps<
260260
propsSafeToSpread,
261261
{
262262
ref,
263-
href: externalLink,
263+
href: externalLink(),
264264
},
265265
Solid.splitProps(local, [
266266
'target',

packages/solid-router/tests/link.test.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,7 @@ describe('Link', () => {
675675
expect(pageZero).toBeInTheDocument()
676676
})
677677

678-
// TODO - THIS WORKS IN REACT
679-
test.skip('when navigation to . from /posts while updating search from /', async () => {
678+
test('when navigation to . from /posts while updating search from /', async () => {
680679
const RootComponent = () => {
681680
return (
682681
<>
@@ -774,12 +773,13 @@ describe('Link', () => {
774773

775774
fireEvent.click(updateSearchLink)
776775

776+
const updatedPage = await screen.findByTestId('current-page')
777+
const updatedFilter = await screen.findByTestId('current-filter')
778+
777779
// Verify search was updated
778780
expect(window.location.pathname).toBe('/posts')
779781
expect(window.location.search).toBe('?page=2&filter=inactive')
780782

781-
const updatedPage = await screen.findByTestId('current-page')
782-
const updatedFilter = await screen.findByTestId('current-filter')
783783
expect(updatedPage).toHaveTextContent('Page: 2')
784784
expect(updatedFilter).toHaveTextContent('Filter: inactive')
785785
})
@@ -1627,8 +1627,7 @@ describe('Link', () => {
16271627
expect(window.location.pathname).toBe('/posts/id1')
16281628
})
16291629

1630-
// TODO - THIS WORKS IN REACT
1631-
test.skip('when navigating from /posts/$postId to "/"', async () => {
1630+
test('when navigating from /posts/$postId to "/"', async () => {
16321631
const rootRoute = createRootRoute({
16331632
component: () => {
16341633
return (
@@ -1745,8 +1744,9 @@ describe('Link', () => {
17451744

17461745
fireEvent.click(homeLink)
17471746

1748-
expect(window.location.pathname).toBe('/')
17491747
const homeHeading = await screen.findByTestId('home-heading')
1748+
1749+
expect(window.location.pathname).toBe('/')
17501750
expect(homeHeading).toBeInTheDocument()
17511751

17521752
expect(consoleWarnSpy).not.toHaveBeenCalled()
@@ -6346,8 +6346,7 @@ describe('when on /posts/$postId and navigating to ../ with default `from` /post
63466346
})
63476347

63486348
describe('rewrite', () => {
6349-
// TODO - THIS WORKS IN REACT
6350-
test.skip('renders hard link when rewrite points to different origin', async () => {
6349+
test('renders hard link when rewrite points to different origin', async () => {
63516350
const rootRoute = createRootRoute()
63526351
const indexRoute = createRoute({
63536352
getParentRoute: () => rootRoute,

0 commit comments

Comments
 (0)