Skip to content

How do I test on different languages when the locales are in the SFC? #1920

Closed Answered by trajano
trajano asked this question in Q&A
Discussion options

You must be logged in to vote

I inlined it so this works

it('should work with mounted component in Spanish', () => {
  const wrapper = mount(LjAge, {
    global: {
      plugins: [
        createI18n({
          locale: 'es'
        })
      ]
    },
    props: {
      birthDate: '2014-11-11',
      today: '2024-07-29'
    }
  })
  expect(wrapper.text()).toBe('9a 8m')
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by trajano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant