Skip to content

Commit 017c52c

Browse files
committed
improve test
1 parent 1057c98 commit 017c52c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: packages/react-router/tests/route.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,16 @@ describe('onEnter event', () => {
202202
component: () => {
203203
return <h1>Index</h1>
204204
},
205-
onEnter: (_, { location }) => {
206-
fn(location)
205+
onEnter: (_, { location: { href, pathname } }) => {
206+
fn({ href, pathname })
207207
},
208208
})
209209
const routeTree = rootRoute.addChildren([indexRoute])
210210
const router = createRouter({ routeTree })
211211

212212
await router.load()
213213

214-
expect(fn).toHaveBeenCalledWith({ pathname: '/' })
214+
expect(fn).toHaveBeenCalledWith({ href: '/', pathname: '/' })
215215
})
216216
})
217217

0 commit comments

Comments
 (0)