Skip to content
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

Router and Route are not available in tests when using vue-i18n-routing and vue-test-utils #92

Open
5 tasks done
BeniRupp opened this issue Apr 17, 2024 · 0 comments
Open
5 tasks done
Labels
status: review needed Request for review

Comments

@BeniRupp
Copy link

Describe the bug

When mounting a component that uses useRoute() or useRouter() with vue-test-utils and a vue-i18n-router, the useRoute and useRouter composables do not return any values. Instead the following error will be printed:

[Vue warn]: injection "Symbol(route location)" not found. 
  at <HelloWorld ref="VTU_COMPONENT" > 
  at <VTUROOT>

When using a vue-router instead of the vue-i18n-router everything is working as expected.

Reproduction

https://stackblitz.com/edit/vitejs-vite-vckr8m?file=tests%2FSample.spec.js

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (2) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.3 - /usr/local/bin/pnpm

Used Package Manager

npm

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@BeniRupp BeniRupp added the status: review needed Request for review label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: review needed Request for review
Projects
None yet
Development

No branches or pull requests

1 participant