mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-27 03:01:14 +08:00
2bba6d570f
- Fix defaultTranslation method that causes error
21 lines
503 B
TypeScript
21 lines
503 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)
|
|
expect(t('el.popconfirm.confirmButtonText')).toBe('Yes')
|
|
})
|
|
})
|