element-plus/packages/locale/__test__/locale.spec.ts
jeremywu 41655b6847
chore(project): adding a script for upgrading vue version (#660)
* chore(project): adding a script for upgrading vue version

* Update locale.spec.ts

Co-authored-by: zazzaz <izazzaz@hotmail.com>
2020-11-23 17:51:51 +08:00

20 lines
442 B
TypeScript

import { t, use } from '../index'
import zhCn from '../lang/zh-cn'
import en from '../lang/en'
describe('Locale', () => {
test('t', () => {
expect(t('el.popconfirm.confirmButtonText')).toBe('Yes')
})
test('return key name if not defined', () => {
expect(t('el.popconfirm.someThing')).toBeUndefined()
})
test('use', () => {
use(zhCn)
expect(t('el.popconfirm.confirmButtonText')).toBe('确定')
use(en)
})
})