chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -24,28 +24,28 @@ import {
|
||||
describe('Project Constants', () => {
|
||||
describe('ProjectRoleType', () => {
|
||||
it('应该定义所有必要的角色类型', () => {
|
||||
// 验证所有角色类型都已定义
|
||||
// Verify that all role types are defined
|
||||
expect(ProjectRoleType.Owner).toBeDefined();
|
||||
expect(ProjectRoleType.Editor).toBeDefined();
|
||||
|
||||
// 验证角色类型的值
|
||||
// Validate the value of the role type
|
||||
expect(ProjectRoleType.Owner).toBe('owner');
|
||||
expect(ProjectRoleType.Editor).toBe('editor');
|
||||
});
|
||||
|
||||
it('应该包含正确数量的角色类型', () => {
|
||||
// 验证角色类型的数量
|
||||
// Number of validation role types
|
||||
const roleTypeCount = Object.keys(ProjectRoleType).filter(key =>
|
||||
isNaN(Number(key)),
|
||||
).length;
|
||||
|
||||
expect(roleTypeCount).toBe(2); // Owner 和 Editor
|
||||
expect(roleTypeCount).toBe(2); // Owner and Editor
|
||||
});
|
||||
});
|
||||
|
||||
describe('EProjectPermission', () => {
|
||||
it('应该定义所有必要的权限点', () => {
|
||||
// 验证所有权限点都已定义
|
||||
// Verify that all permission spots are defined
|
||||
expect(EProjectPermission.View).toBeDefined();
|
||||
expect(EProjectPermission.EDIT_INFO).toBeDefined();
|
||||
expect(EProjectPermission.DELETE).toBeDefined();
|
||||
@@ -60,17 +60,17 @@ describe('Project Constants', () => {
|
||||
});
|
||||
|
||||
it('应该为每个权限点分配唯一的值', () => {
|
||||
// 创建一个集合来存储所有权限点的值
|
||||
// Create a collection to store the values of all permission spots
|
||||
const permissionValues = new Set();
|
||||
|
||||
// 获取所有权限点的值
|
||||
// Get values for all permission spots
|
||||
Object.values(EProjectPermission)
|
||||
.filter(value => typeof value === 'number')
|
||||
.forEach(value => {
|
||||
permissionValues.add(value);
|
||||
});
|
||||
|
||||
// 验证权限点的数量与唯一值的数量相同
|
||||
// The number of validation permission spots is the same as the number of unique values
|
||||
const numericKeys = Object.keys(EProjectPermission).filter(
|
||||
key => !isNaN(Number(key)),
|
||||
).length;
|
||||
@@ -79,12 +79,12 @@ describe('Project Constants', () => {
|
||||
});
|
||||
|
||||
it('应该包含正确数量的权限点', () => {
|
||||
// 验证权限点的数量
|
||||
// Number of permission spots verified
|
||||
const permissionCount = Object.keys(EProjectPermission).filter(key =>
|
||||
isNaN(Number(key)),
|
||||
).length;
|
||||
|
||||
expect(permissionCount).toBe(12); // 11个权限点
|
||||
expect(permissionCount).toBe(12); // 11 permission spots
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user