Skip to content

Commit 93a5141

Browse files
committed
add test
1 parent cf005d4 commit 93a5141

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/diretive.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,24 @@ test('legacy mode', async () => {
178178
expect(wrapper.html()).toEqual('<p>hello!</p>')
179179
})
180180

181+
test('using in template', async () => {
182+
const i18n = createI18n({
183+
locale: 'en',
184+
messages: {
185+
en: {
186+
hello: 'hello!'
187+
}
188+
}
189+
})
190+
191+
const App = defineComponent({
192+
template: `<p v-t="'hello'"></p>`
193+
})
194+
const wrapper = await mount(App, i18n)
195+
196+
expect(wrapper.html()).toEqual('<p>hello!</p>')
197+
})
198+
181199
describe('errors', () => {
182200
test(errorMessages[I18nErrorCodes.NOT_FOUND_COMPOSER], async () => {
183201
const i18n = createI18n({

0 commit comments

Comments
 (0)