Skip to content

Commit b097f19

Browse files
add missing routes to e2e test
1 parent 184216e commit b097f19

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createRootRoute } from '@tanstack/react-router'
2+
3+
export const Route = createRootRoute()
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { createFileRoute } from '@tanstack/react-router'
2+
3+
export const Route = createFileRoute('/about')({
4+
component: RouteComponent,
5+
})
6+
7+
function RouteComponent() {
8+
const navigate = Route.useNavigate()
9+
10+
return (
11+
<div data-testid="about-component">
12+
<button
13+
onClick={() => navigate({ to: '/', reloadDocument: true })}
14+
data-testid="to-home-btn"
15+
>
16+
Navigate to / with document reload
17+
</button>
18+
</div>
19+
)
20+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { createFileRoute } from '@tanstack/react-router'
2+
3+
export const Route = createFileRoute('/')({
4+
component: App,
5+
})
6+
7+
function App() {
8+
const navigate = Route.useNavigate()
9+
10+
return (
11+
<div data-testid="home-component">
12+
<button
13+
data-testid="to-about-btn"
14+
onClick={() =>
15+
navigate({
16+
to: '/about',
17+
reloadDocument: true,
18+
})
19+
}
20+
>
21+
Navigate to /about with document reload
22+
</button>
23+
</div>
24+
)
25+
}

0 commit comments

Comments
 (0)