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

Vue-I18n translations bugs with Vue Testing Library, but working with Vue Test Utils. #318

Open
ben-hamel opened this issue Jul 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ben-hamel
Copy link

Describe the bug
Vue Testing Library isn't handling translations correctly with Vue-i18n. When using Vue Testing library you can translate once for local scoped messages but then it won't work again after that. Global messages seem to work okay though. Vue Test Utils can handle both correctly so it seems to be an issue with Vue Test Library afaik.

To Reproduce Steps to reproduce the behavior:
You can view the tests I have in this repo to reproduce - https://github.com/ben-hamel/vtl-i18n-bug.
I have added Vue Testing Library and Vue Test Utils, test have be recreated for both options. I have labeled tests VTL(Vue Testing Library) and VTU(Vue Test Utils) to help differentiate.

Expected behavior
When translating tests, local scope will change with the global scope as can be found in Vue Test Utils tests in my repo linked above.

Related information:

  • @testing-library/vue version: "^2.4.6"
  • Vue version: "^3.4.29"
  • node version: v20.11.0
  • npm (or yarn) version: 10.2.4

Relevant code or config (if any)

To test run

 npm run test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant