chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -249,8 +249,8 @@ describe('useMockSetInSettingModalController', () => {
|
||||
|
||||
await waitForNextUpdate();
|
||||
|
||||
expect(result.current.isEnabled).toBeFalsy(); // 初始状态应该是不启用
|
||||
expect(result.current.mockSetData).toEqual([]); // 初始mockSetData应该是空数组
|
||||
expect(result.current.isEnabled).toBeFalsy(); // The initial state should be not enabled
|
||||
expect(result.current.mockSetData).toEqual([]); // The initial mockSetData should be an empty array
|
||||
});
|
||||
|
||||
it('should act export action', async () => {
|
||||
@@ -260,25 +260,25 @@ describe('useMockSetInSettingModalController', () => {
|
||||
|
||||
await waitForNextUpdate();
|
||||
|
||||
expect(result.current.isEnabled).toBeTruthy(); // 有选中的mock数据的前提下,会自动启用
|
||||
expect(result.current.mockSetData.length).toEqual(7); // mockSetData 数据是 7
|
||||
expect(result.current.isEnabled).toBeTruthy(); // If there is selected mock data, it will be automatically enabled
|
||||
expect(result.current.mockSetData.length).toEqual(7); // mockSetData is 7.
|
||||
|
||||
act(() => result.current.doSetCreateModal(true));
|
||||
expect(result.current.showCreateModal).toBeTruthy(); // 打开创建modal
|
||||
expect(result.current.showCreateModal).toBeTruthy(); // Open Create modal
|
||||
|
||||
act(() => result.current.doHandleView({ id: 'record-id' })); // 点击查看
|
||||
act(() => result.current.doHandleView({ id: 'record-id' })); // Click to view
|
||||
|
||||
act(() => result.current.doEnabled()); // 关闭
|
||||
expect(result.current.isEnabled).toBeFalsy(); // 禁用
|
||||
act(() => result.current.doEnabled()); // close
|
||||
expect(result.current.isEnabled).toBeFalsy(); // disable
|
||||
|
||||
act(() => result.current.doSetDeleteId('record-id')); // 删除
|
||||
act(() => result.current.doSetDeleteId('record-id')); // delete
|
||||
expect(result.current.deleteRenderTitle).toBe(
|
||||
'Translated: delete_the_mockset {}',
|
||||
); // 删除后应该显示删除的title
|
||||
); // The deleted title should be displayed after deletion.
|
||||
|
||||
act(() => result.current.doConfirmDelete()); // 确认删除
|
||||
act(() => result.current.doConfirmDelete()); // Confirm deletion
|
||||
|
||||
act(() => result.current.doChangeMock({ id: 'change-mock' })); // 修改mock
|
||||
expect(result.current.selectedMockSet).toStrictEqual({ id: 'change-mock' }); // 修改mock后应该显示新的mock
|
||||
act(() => result.current.doChangeMock({ id: 'change-mock' })); // Modify mock
|
||||
expect(result.current.selectedMockSet).toStrictEqual({ id: 'change-mock' }); // After modifying the mock, the new mock should be displayed.
|
||||
});
|
||||
});
|
||||
|
||||
@@ -92,7 +92,7 @@ describe('useSaveMockData', () => {
|
||||
|
||||
const { result } = renderHook(() =>
|
||||
useSaveMockData({
|
||||
mockSetId: undefined, // 测试没有mockSetId的情况
|
||||
mockSetId: undefined, // Test without mockSetId
|
||||
basicParams: {
|
||||
environment: 'environment',
|
||||
workspace_id: 'workspace_id',
|
||||
|
||||
@@ -53,8 +53,8 @@ vi.mock('@coze-arch/bot-tea', () => ({
|
||||
},
|
||||
ParamsTypeDefine: {},
|
||||
PluginMockDataGenerateMode: {
|
||||
MANUAL: 0, // 手动创建
|
||||
RANDOM: 1, // 随机生成
|
||||
MANUAL: 0, // create manually
|
||||
RANDOM: 1, // random generation
|
||||
LLM: 2,
|
||||
},
|
||||
}));
|
||||
@@ -62,21 +62,21 @@ vi.mock('@coze-arch/bot-tea', () => ({
|
||||
vi.mock('@coze-arch/bot-hooks', () => ({
|
||||
SceneType: {
|
||||
BOT__VIEW__WORKFLOW: 'botViewWorkflow',
|
||||
/** bot 详情页查看 workflow,或新建 workflow 但未发布,点击返回 */
|
||||
/** View the workflow on the bot details page, or create a new workflow but not published, click Return */
|
||||
WORKFLOW__BACK__BOT: 'workflowBackBot',
|
||||
/** bot 详情页创建 workflow,在 workflow 发布后返回 */
|
||||
/** The bot details page creates a workflow and returns it after the workflow is published */
|
||||
WORKFLOW_PUBLISHED__BACK__BOT: 'workflowPublishedBackBot',
|
||||
/** bot 详情页进入 mock data 页面 */
|
||||
/** Bot details page Enter the mock data page */
|
||||
BOT__TO__PLUGIN_MOCK_DATA: 'botToPluginMockData',
|
||||
/** workflow 详情页进入 mock data 页面 */
|
||||
/** Workflow details page Enter the mock data page */
|
||||
WORKFLOW__TO__PLUGIN_MOCK_DATA: 'workflowToPluginMockData',
|
||||
/** mock set 页进入 mock data 页面 */
|
||||
/** Mock set page Enter the mock data page */
|
||||
PLUGIN_MOCK_SET__TO__PLUGIN_MOCK_DATA: 'pluginMockSetToPluginMockData',
|
||||
/** bot 详情页进入 knowledge 页面 */
|
||||
/** Bot details page Enter the knowledge page */
|
||||
BOT__VIEW__KNOWLEDGE: 'botViewKnowledge',
|
||||
/** knowledge 页面点击退出返回 bot 详情页(未点击添加) */
|
||||
/** Knowledge page Click Exit to return to bot details page (not clicked Add) */
|
||||
KNOWLEDGE__BACK__BOT: 'knowledgeBackBot',
|
||||
/** knowledge 页面点击返回 bot 详情页,并添加到 bot */
|
||||
/** Knowledge page Click to return to bot details page and add to bot */
|
||||
KNOWLEDGE__ADD_TO__BOT: 'knowledgeAddToBot',
|
||||
},
|
||||
usePageJumpService: vi.fn().mockReturnValue({
|
||||
|
||||
Reference in New Issue
Block a user