Skip to content

Commit 306550f

Browse files
author
Max Arndt
committed
test: visualize VueRouter isolation bug
1 parent 7bef579 commit 306550f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/__tests__/vue-router.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,27 @@ const routes = [
1313

1414
test('full app rendering/navigating', async () => {
1515
// Notice how we pass a `routes` object to our render function.
16-
const {getByTestId} = render(App, {routes})
16+
const {getByTestId, getByText} = render(App, {routes})
1717

18+
expect(getByText(/you are home/i)).toBeInTheDocument()
1819
expect(getByTestId('location-display')).toHaveTextContent('/')
1920

2021
await fireEvent.click(getByTestId('about-link'))
2122

23+
expect(getByText(/you are on the about page/i)).toBeInTheDocument()
24+
expect(getByTestId('location-display')).toHaveTextContent('/about')
25+
})
26+
27+
test('another app rendering/navigating', async () => {
28+
// Notice how we pass a `routes` object to our render function.
29+
const {getByTestId, getByText} = render(App, {routes})
30+
31+
expect(getByText(/you are home/i)).toBeInTheDocument()
32+
expect(getByTestId('location-display')).toHaveTextContent('/')
33+
34+
await fireEvent.click(getByTestId('about-link'))
35+
36+
expect(getByText(/you are on the about page/i)).toBeInTheDocument()
2237
expect(getByTestId('location-display')).toHaveTextContent('/about')
2338
})
2439

0 commit comments

Comments
 (0)