|
1 | | -import '@testing-library/jest-dom' |
2 | | -import {render, fireEvent} from '@testing-library/vue' |
3 | | -import Vuei18n from 'vue-i18n' |
4 | | -import VueI18n from './components/VueI18n' |
5 | | - |
6 | | -const messages = { |
7 | | - en: { |
8 | | - Hello: 'Hello', |
9 | | - }, |
10 | | - ja: { |
11 | | - Hello: 'こんにちは', |
12 | | - }, |
13 | | -} |
14 | | - |
15 | | -test('renders translations', async () => { |
16 | | - const {queryByText, getByText} = render(VueI18n, {}, vue => { |
17 | | - // Let's register Vuei18n normally |
18 | | - vue.use(Vuei18n) |
19 | | - |
20 | | - const i18n = new Vuei18n({ |
21 | | - locale: 'en', |
22 | | - fallbackLocale: 'en', |
23 | | - messages, |
24 | | - }) |
25 | | - |
26 | | - // Notice how we return an object from the callback function. It will be |
27 | | - // available as an additional option on the created Vue instance. |
28 | | - return {i18n} |
29 | | - }) |
30 | | - |
31 | | - expect(getByText('Hello')).toBeInTheDocument() |
32 | | - |
33 | | - await fireEvent.click(getByText('Japanese')) |
34 | | - |
35 | | - expect(getByText('こんにちは')).toBeInTheDocument() |
36 | | - |
37 | | - expect(queryByText('Hello')).toBeNull() |
38 | | -}) |
| 1 | +test.todo('Your test suite must contain at least one test.') |
| 2 | + |
| 3 | +// import '@testing-library/jest-dom' |
| 4 | +// import {render, fireEvent} from '@testing-library/vue' |
| 5 | +// import Vuei18n from 'vue-i18n' |
| 6 | +// import VueI18n from './components/VueI18n' |
| 7 | + |
| 8 | +// const messages = { |
| 9 | +// en: { |
| 10 | +// Hello: 'Hello', |
| 11 | +// }, |
| 12 | +// ja: { |
| 13 | +// Hello: 'こんにちは', |
| 14 | +// }, |
| 15 | +// } |
| 16 | + |
| 17 | +// test('renders translations', async () => { |
| 18 | +// const {queryByText, getByText} = render(VueI18n, {}, vue => { |
| 19 | +// // Let's register Vuei18n normally |
| 20 | +// vue.use(Vuei18n) |
| 21 | + |
| 22 | +// const i18n = new Vuei18n({ |
| 23 | +// locale: 'en', |
| 24 | +// fallbackLocale: 'en', |
| 25 | +// messages, |
| 26 | +// }) |
| 27 | + |
| 28 | +// // Notice how we return an object from the callback function. It will be |
| 29 | +// // available as an additional option on the created Vue instance. |
| 30 | +// return {i18n} |
| 31 | +// }) |
| 32 | + |
| 33 | +// expect(getByText('Hello')).toBeInTheDocument() |
| 34 | + |
| 35 | +// await fireEvent.click(getByText('Japanese')) |
| 36 | + |
| 37 | +// expect(getByText('こんにちは')).toBeInTheDocument() |
| 38 | + |
| 39 | +// expect(queryByText('Hello')).toBeNull() |
| 40 | +// }) |
0 commit comments