Skip to content

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

Open
@ben-hamel

Description

@ben-hamel

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions