Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 16 additions & 1 deletion
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(/youarehome/i)).toBeInTheDocument()
1819
expect(getByTestId('location-display')).toHaveTextContent('/')
1920

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

23+
expect(getByText(/youareontheaboutpage/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(/youarehome/i)).toBeInTheDocument()
32+
expect(getByTestId('location-display')).toHaveTextContent('/')
33+
34+
await fireEvent.click(getByTestId('about-link'))
35+
36+
expect(getByText(/youareontheaboutpage/i)).toBeInTheDocument()
2237
expect(getByTestId('location-display')).toHaveTextContent('/about')
2338
})
2439

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /