test: update test

This commit is contained in:
zazzaz
2020-08-03 21:32:59 +08:00
committed by jeremywu
parent 328eee8d9c
commit 90ae785beb

View File

@@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils'
import { t, use } from '../index'
import localeMixin from '../mixin'
import zhCn from '../lang/zh-CN'
import en from '../lang/en'
describe('Locale', () => {
test('t', () => {
@@ -15,13 +16,14 @@ describe('Locale', () => {
test('use', () => {
use(zhCn)
expect(t('el.popconfirm.confirmButtonText')).toBe('确定')
use(en)
})
test('mixin', () => {
const component = {
template: `<p>{{ t('el.popconfirm.cancelButtonText') }}</p>`,
mixins: [localeMixin],
}
} as any
const wrapper = mount(component)
expect(wrapper.text()).toContain('No')
})