Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/__tests__/vue-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ const routes = [

test('full app rendering/navigating', async () => {
// Notice how we pass a `routes` object to our render function.
const {queryByTestId} = render(App, {routes})
const {getByTestId} = render(App, {routes})

expect(queryByTestId('location-display')).toHaveTextContent('/')
expect(getByTestId('location-display')).toHaveTextContent('/')

await fireEvent.click(queryByTestId('about-link'))
await fireEvent.click(getByTestId('about-link'))

expect(queryByTestId('location-display')).toHaveTextContent('/about')
expect(getByTestId('location-display')).toHaveTextContent('/about')
})

test('setting initial route', () => {
// The callback function receives three parameters: the Vue instance where
// the component is mounted, the store instance (if any) and the router
// object.
const {queryByTestId} = render(App, {routes}, (vue, store, router) => {
const {getByTestId} = render(App, {routes}, (vue, store, router) => {
router.push('/about')
})

expect(queryByTestId('location-display')).toHaveTextContent('/about')
expect(getByTestId('location-display')).toHaveTextContent('/about')
})