chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -13,31 +13,31 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
import { i18nContext } from '../../src/i18n-provider/context';
|
||||
|
||||
describe('i18n-provider/context', () => {
|
||||
it('should create a context with default values', () => {
|
||||
// 验证 i18nContext 是否被正确创建
|
||||
// Verify that i18nContext was created correctly
|
||||
expect(i18nContext).toBeDefined();
|
||||
|
||||
// 获取默认值 - 使用类型断言访问内部属性
|
||||
// @ts-expect-error - 访问内部属性
|
||||
// Get Default Values - Use Type Assertions to Access Internal Properties
|
||||
// @ts-expect-error - access internal properties
|
||||
const defaultValue = i18nContext._currentValue;
|
||||
|
||||
// 验证默认值中的 i18n 对象是否存在
|
||||
// Verify that the i18n object in the default value exists
|
||||
expect(defaultValue.i18n).toBeDefined();
|
||||
|
||||
// 验证 t 函数是否存在
|
||||
// Verify that the t function exists
|
||||
expect(defaultValue.i18n.t).toBeDefined();
|
||||
expect(typeof defaultValue.i18n.t).toBe('function');
|
||||
|
||||
// 验证 t 函数的行为
|
||||
// Verify the behavior of the t function
|
||||
expect(defaultValue.i18n.t('test-key')).toBe('test-key');
|
||||
|
||||
// 验证 i18nContext 是一个对象
|
||||
// Verify that i18nContext is an object
|
||||
expect(typeof i18nContext).toBe('object');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user