-
@@ -277,6 +277,7 @@ const AgentTools: FC = () => {
}}
onMouseOver={() => setIsDeleting(index)}
onMouseLeave={() => setIsDeleting(-1)}
+ data-testid='delete-removed-tool'
>
diff --git a/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.spec.tsx b/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.spec.tsx
new file mode 100644
index 0000000000..8cd95472dc
--- /dev/null
+++ b/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.spec.tsx
@@ -0,0 +1,248 @@
+import React from 'react'
+import { render, screen, waitFor } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import SettingBuiltInTool from './setting-built-in-tool'
+import I18n from '@/context/i18n'
+import { CollectionType, type Tool, type ToolParameter } from '@/app/components/tools/types'
+
+const fetchModelToolList = jest.fn()
+const fetchBuiltInToolList = jest.fn()
+const fetchCustomToolList = jest.fn()
+const fetchWorkflowToolList = jest.fn()
+jest.mock('@/service/tools', () => ({
+ fetchModelToolList: (collectionName: string) => fetchModelToolList(collectionName),
+ fetchBuiltInToolList: (collectionName: string) => fetchBuiltInToolList(collectionName),
+ fetchCustomToolList: (collectionName: string) => fetchCustomToolList(collectionName),
+ fetchWorkflowToolList: (appId: string) => fetchWorkflowToolList(appId),
+}))
+
+type MockFormProps = {
+ value: Record