Skip to content

injected router not passed to child-components? #679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
doppelreim opened this issue Jun 4, 2018 · 3 comments
Closed

injected router not passed to child-components? #679

doppelreim opened this issue Jun 4, 2018 · 3 comments
Labels

Comments

@doppelreim
Copy link

Version

1.0.0-beta.16

Reproduction link

https://github.com/doppelreim/vue-test-app/tree/test-route-in-child

Steps to reproduce

Run ./node_modules/.bin/vue-cli-service test:unit

What is expected?

The test should not explode.

What is actually happening?

It does explode.

Error:

 HelloWorld.vue
[Vue warn]: Error in config.errorHandler: "TypeError: Cannot read property 'query' of undefined"
TypeError: Cannot read property 'query' of undefined

The test tests HelloWorld.vue

HelloWorld.vue includes a child-component (TheChild.vue)

TheChild makes use of the router.

In the test, I inject a router-mock into the localvue.

My best guess is, that the injected routerMock is visible only in the component under test, and it is somehow not visible in the child-component?

(This is the same problem as #591 - that ticket was closed, but the issue is still there and I can not reopen it)

@doppelreim
Copy link
Author

I updated vue-test-utils to beta18 and vue to beta15
The issue still persists, though :/

@eddyerburgh
Copy link
Member

This should be fixed in beta.19

@doppelreim
Copy link
Author

@eddyerburgh
I updated vue-test-utils to beta19.
The issue still persists, though :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants